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
 looping over columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

asouthar

USA
Posts

Posted - 02/22/2012 :  6:12:05 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin version 8.1 SR1
Operating System: Windows 7 64 bit

I'm trying to set the long name of about 18 columns to a number which is stored in a dataset. I would like to do this with a simple loop:

create dataset -t 18;
dataset={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18};

for (ii=1; ii<19;ii++)
{z=dataset[ii];
col($(ii))[L]$=$(z);}

Even though this works in the script window, it doesn't work when I run the lines with the code builder.
I keep getting an error saying that z doesn't have proper variable name.

Please advise.

Penn

China
644 Posts

Posted - 02/22/2012 :  10:48:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am not sure what you mean "run the lines with the code builder". Of course, there is a LabTalk Console for running LabTalk script in Code Builder. Do you mean run the script there? However, I have run your script there, and it is fine. If not this, please provide more details.

Penn
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