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
 Worksheet Columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kemeyer

39 Posts

Posted - 07/28/2009 :  4:36:27 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 7 and Service Release (Select Help-->About Origin):
Operating System:XP

Hi,

I am trying to set new columns I add in as either X or Y. I found the command Worksheet -t colRef colType to do so, but it requires a number for column type. As my program is set up, users can enter various column names at different times, so I won't be able to know where column Label1 is positionwise. Is there a way to return the number value of a column of colName? I wasn't able to find anything, so instead I tried to do this:

for(i=1; i<=%(%C,@#); i+=1){
if(%(i,@C); == "Label1")
colNum=i;
}

I used this to try and figure out the column number, but for whatever reason when I add the columns with the wks.addCol command, %%C,@#)evaluates to 2 rather than the 3 that there is. Why is that?

easwar

USA
1965 Posts

Posted - 07/28/2009 :  5:01:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can get index from short name using:

%a="shortname";
colnum(%a)=;


This also works in new version 8.0, but in 8.0 one can also get the index even using long name such as:

range r=col("system pressure");
r.index=;


Easwar
OriginLab
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