Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10
Hello,
I have a complex importing LT code with several for () commands, each one of which addresses a set of subfolders one level deeper than the last.
I need to run the same exact code for 2 different folders, say, A and B. I intend to create a project folder structure where folder A is created, imports the corresponding datasets, and then creates a second folder called B, importing its own datasets.
I created a string array adding A and B. The (very) simplified version of my code is:
string strPath$ = "D:\Samples\";
path$ = strPath$;
stringarray Fols;
Fols.add("A");
Fols.add("B");
loop(hh,1,Fols.GetSize())
{
string ProjFols$ = Fols.GetAt(hh)$;
pe_mkdir folder:=ProjFols$ cd:=1;
//Several For commands here
string FolPath$ = strPath$+(Several strings from previous For commands)+ProjFols$;
path$ = FolPath$;
//impASC fumction
pe_cd /
}
The code works perfectly, but only for folder A. Folder B never gets created or imported from.
Am I using Loop comand wrongly? I tried ProjFols$=; first to see if the strings were listed correctly, and they were. Also, it strikes me as weird that it does read A, but not B. If the code made no sense, I wouldn't expect to have anything imported.