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
 How to set values of multiple column?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

daliss

France
Posts

Posted - 04/20/2006 :  10:37:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

larry_lan

China
Posts

Posted - 04/20/2006 :  7:48:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

daliss

France
Posts

Posted - 04/20/2006 :  10:57:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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