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
 string variables for "label -n ..."

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
drreaf Posted - 06/10/2008 : 11:28:13 AM
Origin Version (Select Help-->About Origin): Origin Pro 7.5 SR6, (B885)
Operating System: Windows XP Professional, SP 3

I want to change the contents of named text labels in graph windows which are created from templates (.otp files). Some of the text labels in the templates need to be replaced by actual strings.

I tried to achieve this by the following LabTalk script. However, the "label –n" command treats the message part of the command as literal.

if (exist(%2)==0)
{
window -t plot %1 %2; // create graph window from template %1 with name %2
%2!page.title = 3; // display name and label
%2!page.label$ = %5; // label window
}

layer -i %3; // plot dataset

// label -n labelName message
tmp$=$(%[%(Exposure$),3]exptm);
label -n Projct ProjNam$;
label -n Expsr Exposure$;
label -n Durat tmp$;

How can I achieve my goal with variable strings containing the message?

Many thanks in advance, Rainer Facius
2   L A T E S T    R E P L I E S    (Newest First)
drreaf Posted - 06/11/2008 : 04:47:58 AM
Thank you. It worked out perfectly.

Rainer Facius
greg Posted - 06/10/2008 : 4:19:54 PM
The addition of string datatype did not automatically make all LabTalk commands that had string options work with the new datatype.

As you discovered, the label command does not yet accept string datatyped variables. The old string variables can be used, as in:

%A = ProjNam$;
label -s -n Projct %A;
%A = Exposure$;
label -s -n Expsr %A;
%A = tmp$
label -s -n Durat %A;


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