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

Sir Anthony

2 Posts

Posted - 07/11/2013 :  04:28:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 8.5.1
Operating System: Windows 7

Hello,
I want to pass a variable name in formula to csetvalue in Code builder without expanding of it.
For certain column I want to have a formula like
Col(A)[i] - %(Col(B)[U]$)
I tried different ways, including escaping and dynamic string building:
csetvalue f:="Col(A)[i] - %%(Col(B)[U]$))" c:=Col(B);
or
csetvalue f:="Col(A)[i] - %" + "(Col(B)[U]$)" c:=Col(B);
tried to define string before:
string pozc = "%%(Col(B)[U]$)";
and debugger shown it works and string contains
%(Col(B)[U]$)
as I want, but when I trying to append this string to the formula it is expanding again and I have nothing in the result. In all cases I got
Col(A)[i] -
instead formula I need. Is there a way to do so, or infinity expansion of variables it is limitation of LabTalk?

cpyang

USA
1406 Posts

Posted - 07/11/2013 :  10:26:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a trick to get around this, try the following:

%A="%";
csetvalue f:="Col(A)[i] - %A(Col(B)[U]$)" c:=Col(B);


CP
Go to Top of Page

Sir Anthony

2 Posts

Posted - 07/11/2013 :  11:32:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It is works for me. Thank you.
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