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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Substitution of variables

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Sir Anthony Posted - 07/11/2013 : 04:28:46 AM
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?
2   L A T E S T    R E P L I E S    (Newest First)
Sir Anthony Posted - 07/11/2013 : 11:32:23 PM
It is works for me. Thank you.
cpyang Posted - 07/11/2013 : 10:26:51 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000