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
 string variables for "label -n ..."
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

drreaf

Germany
45 Posts

Posted - 06/10/2008 :  11:28:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

greg

USA
1380 Posts

Posted - 06/10/2008 :  4:19:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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;

Go to Top of Page

drreaf

Germany
45 Posts

Posted - 06/11/2008 :  04:47:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you. It worked out perfectly.

Rainer Facius
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