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
 How to set values of multiple column?

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
daliss Posted - 04/20/2006 : 10:37:41 AM
Origin Version (Select Help-->About Origin):
Operating System:

Hello all,

I want to set values of multiple colunm through LabTalk script listed as following:

for(i=2;i<=7;i++){
col(i)=col(i)-255;
};

After script running, no response happens. If I only set value of one or two column through this script:

col(2)=col(2)-255;
col(3)=col(3)-255;
....

That is ok. Anybody could give me some suggestions.

Thanks in advance.

William Peng
2   L A T E S T    R E P L I E S    (Newest First)
daliss Posted - 04/20/2006 : 10:57:19 PM
Hi Larry,

Thank you for your help.
I am understanding col(colname) function little by little from your rectification for my false script. For my initial script, I think the value of i could be replace and a integer would take place of i in col(i). Actually, in col(i), i will be deemed to the column name not the column number.

On base of your script, I have a try to write another script by use of column label;

for(i=2;i<=7;i++){
%N = %(i, @L);
col(%N)=col(%N)-255;
};

Fortunately, it is work well too.
So Thank your very much.

William Peng

Edited by - daliss on 04/20/2006 10:59:15 PM
larry_lan Posted - 04/20/2006 : 7:48:25 PM
Hi William:

Once including variables in col(colName) function, $() notation should be used to change the colName into string:

for(ii=2;ii<=7;ii++)
{
col($(ii))=col($(ii))-225;
}

Then it's OK.

Larry
OriginLab GZ Office

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