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
 Set column values with Labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cougar2

Germany
Posts

Posted - 10/05/2004 :  03:57:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Win2000

I have a worksheet called "Winkel" and need to set the values for a number of columns.
Here is part of my Labtalk-script. All columns exist.

gradschritt=20;
zahlgrad=360/$(gradschritt);
qq=($(zahlgrad)*2)+3;
tt=0;
for (ii=2;ii<=$(qq);ii=ii+2){
Winkel!wks.col$(ii).label$=x(cos) $(tt)°; // Label columns
Winkel!wks.col$(ii)=col(a)*cos($(tt)); // This doesn´t work! (1)
tt=$(tt)+$(gradschritt);
};


In line (1) I would like to do the labtalk equivalent of "set column values", which is, calculate the values for the ii-th column by doing some math with cosine and column(a).
I also tried the method
Winkel_wks.col$(ii)=col(a)*cos(20);
but it doesn´t work either.
Just using col(b) = col(a)*cos(20) works fine but I´d like to do it in the for-loop.

Mike Buess

USA
3037 Posts

Posted - 10/05/2004 :  07:58:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can't use wks.col to assign column values so neither of the methods you tried should work. This will...

%A=Winkel!wks.col$(ii).name$;
Winkel_%A=col(a)*cos(20);

Also, you're using the $() notation unnecessarily. It's only needed to express number as string.

gradschritt=20;
zahlgrad=360/gradschritt;
qq=(zahlgrad*2)+3;
tt=0;
for (ii=2;ii<=qq;ii=ii+2) {
Winkel!wks.col$(ii).label$=x(cos) $(tt)°; // Label columns
%A=Winkel!wks.col$(ii).name$;
Winkel_%A=col(a)*cos(tt);
tt=tt+gradschritt;
};

Mike Buess
Origin WebRing Member
Go to Top of Page

cougar2

Germany
Posts

Posted - 10/05/2004 :  08:38:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot!

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