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
 How to return the column value from string¡H
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Anow

Taiwan
Posts

Posted - 02/20/2006 :  9:51:23 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): Pro7.5
Operating System: XP

Now, I have two column. First column's values are Text¡]string¡^ and second column's values are numbers. How can I get the numbers of second column by using the text¡]string¡^ of first column.

Ex. Data_A[1]=a, Data_A[2]=b, Data_B[1]=2, Data_B[2]=3
I want to use the property string "b" and return value "3".
My idea seems Data_B(b)=3, but this method is wrong due to "b" string.

rexsoft

S. Korea
Posts

Posted - 02/21/2006 :  12:29:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Data2_A[2]$=test;

may be you success !!
Go to Top of Page

Anow

Taiwan
Posts

Posted - 02/22/2006 :  11:20:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I want "Data_B(b)=3".String "b" is xvalue and Number 3 is "yvalue"(col(B)) accroding to xvalue. Not Data2_A[2]$=test.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/22/2006 :  1:33:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sounds like you have a worksheet with two columns, the first has string values and the second has numeric values...

A B
a 2
b 3
c 4

You want to find the numeric value for a given string. If that's correct then this will work...

%A=b;
nn=0/0;
for(ii=1;ii<=wks.maxrows;ii++) {
if(cell(ii,1)$==%A) {nn=cell(ii,2); break};
};
nn=;
NN=3

Mike Buess
Origin WebRing Member
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