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
 if-condition in a for-loop

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
uli_15 Posted - 12/23/2008 : 06:33:42 AM
Origin Ver. and SR (Select Help-->About Origin): 7.5
Operating System: WinXP

Dear all,

for column labeling I loop over all worksheets with specific names
and label the respective 3rd column as a function of the counter i.
In the beginning of the loop I have an if-condition which works fine.
The worksheets have names like f1p6cv001, f1p6cv002, etc.
But for some reason using the second if-conditions for the column labeling does not work. Here is the code:

%M="f1p6cv";
for(i=1;i<56;i++)
{
if(i<10) %N=%M00$(i); else %N=%M0$(i);
win -a %N; type -c "%N";
if(i<=12) wks.col3.label$="$((i-1)*0.25)";
if(12<i&&i<33) wks.col3.label$="$(i-10)";
else wks.col3.label$="$((i-21)*2)";
};


If I do it by hand, i.e. three different for-loops, it works of course. But why does LabTalk not let me use the if-condition in front of the wks.col3.label$-command?
If I use just another if-condition, like e.g.
if(i<13) type -c "i<13";
after the line
win -a %N; type -c "%N";
it works again.

Can anybody help?

Regards,
Uli
1   L A T E S T    R E P L I E S    (Newest First)
Laurie Posted - 12/29/2008 : 5:13:31 PM
Hi Uli,

It seems to work fine here. Do you know if you have SR6 (service release 6)? Please select Help:Check for Updates to see if any updates are available.

Laurie

OriginLab Technical Support

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