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
 if-condition in a for-loop
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

uli_15

Germany
Posts

Posted - 12/23/2008 :  06:33:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Laurie

USA
404 Posts

Posted - 12/29/2008 :  5:13:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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