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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 looping over columns

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
asouthar Posted - 02/22/2012 : 6:12:05 PM
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.
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 02/22/2012 : 10:48:57 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000