| Author |
Topic  |
|
|
daliss
France
Posts |
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
|
|
|
larry_lan
China
Posts |
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 |
 |
|
|
daliss
France
Posts |
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 |
 |
|
| |
Topic  |
|
|
|