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
 Origin Forum
 Read col index
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dominik.mierzwa

Poland
124 Posts

Posted - 05/31/2021 :  1:51:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2021b
Operating System: W10

Hi,
How to get the index of the column with LT? I would like to use function for particular column and need to get one parameter from a long name of this column e.g. col(1)[L] but I would like to get more universal function which will work with any column (read the index of the column before script execution).

Kind regards,
Dominik

YimingChen

1685 Posts

Posted - 06/01/2021 :  08:57:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Not quite sure about your question. Do you want to get the column index from column short name? If so, try:
colNum(C)=


James

Edited by - YimingChen on 06/01/2021 09:01:20 AM
Go to Top of Page

dominik.mierzwa

Poland
124 Posts

Posted - 06/01/2021 :  09:44:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I need to get the variable (string) from a long name of a column in which I introduce the formula e.g. for col(A) I'm using Before script formula:
string str1=col(A)[L]$  OR
string str1=col(1)[L]$


But it forces me to define the column name/index (A or 1). I would like to have a script that read the column index and put it into the definition. For example in col(C) it will automatically change the index for 3:

string str1=col(C)[L]$  OR
string str1=col(3)[L]$


In this scenario I do not need to worry about the column index, it always read the index of a particular column.


Kind regards,
Dominik
Go to Top of Page

YimingChen

1685 Posts

Posted - 06/01/2021 :  10:01:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use this:
string str1 = wcol(j)[L]$


James
Go to Top of Page

dominik.mierzwa

Poland
124 Posts

Posted - 06/01/2021 :  10:26:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
No way, I have tried this but forgot to add $ at the end.... Thank you :)

Kind regards,
Dominik
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