Origin Ver. and Service Release (Select Help-->About Origin): 8.6 Operating System: winXP
Hi, here is my code. It prompts to a folder, import all files with given extention and place them in folder with name=name of the file, and finally make a plot for each file. Now, I am trying to add a newsheet to each wrksheet (start at line comment: " //begin new lines ". But it does not work. I get a "Command Error" line. I tried doing that with the command prompt (i.e will run the script without the addes lines) and then run the added lines with command prompt. and that works soI am not sure where I get it wrong: Below is the code: >> dlgpath;
// Find all files and count how many there are findfiles ext:="*.svd"; int numFiles = fname.GetNumTokens(LF);
// Loop over all files int nFirst = 1; for(int ifile = 1; ifile <= numFiles; ifile++) { string filepath$, filename$, subFolderPath$; // Get next file name filepath$=fname.gettoken(ifile,LF)$; subFolderPath$ = filepath$+"/0_"+ifile; // Parse out just file name without path and without extension filename$ = filepath.GetFileName(1)$; // Make a new PE subfolder using the file name and set it active pe_mkdir filename$ cd:=1; // Add a new book and import data file // Filter for file import PL Loop Analyis SVD Loop is in user folder // The filter imports the data columns with appropriate names and X or Y settings newbook; impfile fname:=filepath$ filtername:="ImportSVDFile.oif" location:=user;
// Remember Book and Sheet names string bkname$ = page.name$; string shname$ = layer.name$; //Activate the worksheet of imported data page.active$= shname$; plotxy iy:=(1,3) plot:=200 ogl:=[<new template:=PKLoop-SingleSVD>];
// Make top X label the filename label -s -xt %(filename$);
//Name window after filename page.label$ = filename$;
//begin new lines page.active$= bkname$; // Active worksheet by name newsheet; //end new lines
// Set PE folder to previous level and go to next file pe_cd ..; };
>>
Thanks for suggestions/comments
|