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
 Setting type for column without using col number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Nilsdalby

Denmark
23 Posts

Posted - 12/13/2014 :  10:39:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 8.6, windows 8.

Hi

This is most likely a very minor syntax detail, but:

Im trying to set type for a column to X (type = 4)in a script. However, the column has a name (ValuepA), not a number, and all examples ive seen of this require the column to be adressed with an integer.

How can i 1) get the col no, or UID of that column from the present string, or 2) use the string-name to set type ?

Thanks, Nils

cpyang

USA
1406 Posts

Posted - 12/13/2014 :  12:08:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use the range notation, like this:


range myCol=col("Measurement Time");
myCol.type=4;



Basically, LabTalk object column can be accessed either using the wks.coln notation, or you define a range variable to refer to it.
Range variable allows you to refer to a column in any book sheet, like:

range AA=[book3]"Experiement A"!col("Start Time");


CP
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