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
 Accessing neighbour 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

mrandersb

25 Posts

Posted - 06/29/2011 :  07:59:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
origin 8 sr0:

Hello i'm accessing a column by its column letter and range notation(in my case column "D"). I need to include data from the column next to it. They are not ordered by the column letters, so I need to get what column index column "D" has, so i can access it by ColIndex("D")+1.

i thougt that the wks.col(D).index was the command i needed, but i always get a command error when calling that.

Anybody has a solution?

couturier

France
291 Posts

Posted - 06/30/2011 :  11:00:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You have to use range notation before using the index property. The following should work:

range aa=D;
range bb=$(aa.index+1);
Go to Top of Page

mrandersb

25 Posts

Posted - 07/01/2011 :  07:08:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I use a rane like this

range cc1 = [test2$]Sheet1!col(%1);

i know the range exist, because when i call cc1[1] i get what is in that column in row one. But i get the error:

CC1.INDEX: object property not found!
Error: --
LabTalk expression error: 2
AA=--

when calling

aa = $(cc1.index);
aa=;

in my script
Go to Top of Page

couturier

France
291 Posts

Posted - 07/01/2011 :  2:26:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, didn't see that you are running 8 sr0.
Not sure the .index property was introduced yet in this version.

you can type cc1.=; and see what properties you get
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 07/01/2011 :  6:54:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Column level Index property was added in Origin 8 SR5, so if you get the latest SR for Origin8, you should be able to get this support.

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