Origin does not execute my script

281 Views Asked by At

I'm trying to execute the following LabTalk script in Origin:

for(ii=1; ii<=4; ii++)
{ 
string iiString$ = $(ii)    
newbook name:="iiString" sheet:=1 option:=lsname
}

I just paste it into Script Window and hit "enter" on my keyboard and nothing happens. I tried also putting a semicolon after:

first row; all text rows; rows in the loop; any of rows.

I also tried version with intended rows that are inside the loop. What may be the problem?

1

There are 1 best solutions below

0
shebang On

Your syntax for calling the string variable is not correct. If you use iiString$ instead of "iiString" it works fine:

for(int ii=1; ii<=4; ii++)
{ 
  string iiString$ = $(ii)    
  newbook name:=iiString$ sheet:=1 option:=lsname
}