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 commands in tree variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JokerOne

Germany
58 Posts

Posted - 02/17/2016 :  08:45:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9 and Service Release 1(Select Help-->About Origin):
Operating System: Win 7

I am keen on using tree variables in my LabTalk code.
Currently, I noticed, that the String-commands cannot be used as I believed they could be used for string-variables within a tree structure.

For example:
tree aaa
>>aaa.str1$ = Albert Einstein
>>bbb$ = aaa.str1$
>>i1 = aaa.str1.Find("Eins")
>>i2 = bbb.Find("Eins")
>>i1 =
results: --
>>i2 =
results: 8

Is there a way, to avoid the workaround to handover the tree-string variable to a dummy-variable prior to such string commands?

Thanks for your help.

P.S.: I tried such things as
(aaa.str).Find... or
(aaa.str)$.Find...
but was not successful, yet.

Hideo Fujii

USA
1582 Posts

Posted - 02/17/2016 :  10:13:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi JokerOne,

The following should work. Please look at the following code:
tree aaa;
aaa.str1$ = "Albert Einstein";
find(aaa.str1$,"Ein")=;
find(aaa.str1$,"Ein")=8
--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 02/17/2016 10:18:47 AM
Go to Top of Page

JokerOne

Germany
58 Posts

Posted - 02/18/2016 :  02:47:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, pretty.

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