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
 Check existence of tree branch or node

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
JokerOne Posted - 03/04/2016 : 10:45:50 AM
Origin Ver. 9.1 and Service Release 1(Select Help-->About Origin):
Operating System: Win 7

Is there a LabTalk command available that can check if a certain tree node or tree branch exists?
e.g.

tree aaa;
aaa.bbb= 1
exist(aaa.bbb) [ = 4 expected, but results:24 ]
exist(aaa.ccc) [ = 0 expected, but results:24 ]


3   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 03/07/2016 : 12:30:37 PM
ORG-875 is the tag that I put down for future references. It is the ID for our internal development database.

CP
JokerOne Posted - 03/07/2016 : 05:52:29 AM
Thank you for your help. Exactly, what I was looking for.
Despite the fact, that I do not know what ORG-875 is, but nevermind.

cpyang Posted - 03/04/2016 : 10:46:05 PM
Looks like we have implemented this for internal use and never documented it. I debugged into it and found ORG-875 and it really work, so you are in luck with this one, see code below

tree aaa;
aaa.bbb= 1;
aaa.ccc= 2;
aaa.ddd= 3;

exist(aaa.anything,24)=;//this will only check the tree existed and no node checking
if(exist(aaa.anyjunk)==24) type "aaa is a tree";
aaa@=;//this should return 2 for a branch
aaa.bbb@=;//this should return 1 for a leaf
if(aaa.ccc@>0) type "aaa.ccc is valid tree node";
if(aaa.junk@==0) type "aaa.junk is not valid";
if(aaa@==2) type "aaa is a tree branch";
if(aaa.bbb@==1) type "aaa.bbb is a tree leaf";



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