The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Origin does not execute my script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

judywatts

USA
1 Posts

Posted - 10/31/2024 :  01:36:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

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?

Edited by - judywatts on 03/05/2025 8:49:33 PM

aplotnikov

Germany
167 Posts

Posted - 10/31/2024 :  8:30:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
for(ii=1; ii<=4; ii++)
{ 
string iiString$ = $(ii);
newbook name:="B%(iiString$)" sheet:=1 option:=lsname;
}
Go to Top of Page

owards

USA
2 Posts

Posted - 03/13/2025 :  05:23:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The problem likely comes from how you're using iiString$ inside newbook. The variable iiString$ is a string, but inside newbook, you are using it as a literal text instead of substituting its value.
Go to Top of Page

owards

USA
2 Posts

Posted - 03/13/2025 :  05:32:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Let me know if you need further clarification.
Go to Top of Page

aplotnikov

Germany
167 Posts

Posted - 03/13/2025 :  07:05:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by owards

The problem likely comes from how you're using iiString$ inside newbook.

The problem is in the ignoring of the requirement to separate operators by a semicolon.

Edited by - aplotnikov on 03/13/2025 07:06:58 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000