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 manipulate the name of objects
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

elfine

China
9 Posts

Posted - 11/14/2008 :  07:29:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
dear sir,
I want to compare the name of a object,for example,a worksheet with a string that comprises of a wildcard.
I want to use this kind of sentence like "if(%H=="data*")" where "*" denote a wildcard .But I can't make it working.
Could you please help me ?
Thank you !

cpyang

USA
1406 Posts

Posted - 11/14/2008 :  7:20:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Assuming you are using Origin 8, then

string name=%H;
if(name.Match("Book*"))
type yes;
else
type no;

See this link for LabTalk string variables:

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:String_%28object%29#Match


CP
Go to Top of Page

elfine

China
9 Posts

Posted - 11/15/2008 :  8:24:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank your kind help!
I use the Origin 7.5 version.
When I type

name=%H;
name=;

It returns

NAME=--

What is the problem ?
quote:
Originally posted by cpyang

Assuming you are using Origin 8, then

string name=%H;
if(name.Match("Book*"))
type yes;
else
type no;

See this link for LabTalk string variables:

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:String_%28object%29#Match


CP


Go to Top of Page

cpyang

USA
1406 Posts

Posted - 11/16/2008 :  8:01:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Time to get Origin 8 :)

LabTalk string variable was added in Origin 8, together with all the new functions. Origin 7.5 only has string registers %A-%Z.

CP
Go to Top of Page

elfine

China
9 Posts

Posted - 11/17/2008 :  01:05:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot!

quote:
Originally posted by cpyang

Time to get Origin 8 :)

LabTalk string variable was added in Origin 8, together with all the new functions. Origin 7.5 only has string registers %A-%Z.

CP


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