2 # Tree construction attributes
4 # Testing attribute: TDataStd_TreeNode
6 # Testing command: ChildNodeNext
8 # Testing command: NewChild
9 # Testing command: AppendNode
10 # Testing command: InitChildNodeIterator
11 # Testing command: ChildNodeMore
16 # Add an attribute to a data framework
18 set aName_Root Label_1
19 Label D ${aLabel_Root}
20 SetName D ${aLabel_Root} ${aName_Root}
23 ###set aChild1 [NewChild D ${aLabel_Root}]
26 SetName D ${aChild1} ${aName1}
29 ###set aChild2 [NewChild D ${aLabel_Root}]
32 SetName D ${aChild2} ${aName2}
34 set aName3 Label_1_1_1
35 ###set aChild3 [NewChild D ${aLabel_Root}]
38 SetName D ${aChild3} ${aName3}
40 set aName4 Label_1_1_2
41 ###set aChild4 [NewChild D ${aLabel_Root}]
44 SetName D ${aChild4} ${aName4}
46 set aName5 Label_1_1_3
47 ###set aChild5 [NewChild D ${aLabel_Root}]
50 SetName D ${aChild5} ${aName5}
52 set aName6 Label_1_2_1
53 ###set aChild6 [NewChild D ${aLabel_Root}]
56 SetName D ${aChild6} ${aName6}
58 set aName7 Label_1_2_2
59 ###set aChild7 [NewChild D ${aLabel_Root}]
62 SetName D ${aChild7} ${aName7}
64 SetNode D ${aLabel_Root}
65 AppendNode D ${aLabel_Root} ${aChild1}
66 AppendNode D ${aLabel_Root} ${aChild2}
67 AppendNode D ${aChild1} ${aChild3}
68 AppendNode D ${aChild1} ${aChild4}
69 AppendNode D ${aChild1} ${aChild5}
70 AppendNode D ${aChild2} ${aChild6}
71 AppendNode D ${aChild2} ${aChild7}
73 # Close/Open the transaction
76 # Forget the attribute
77 ForgetAll D ${aLabel_Root}
79 # Close/Open the transaction
87 # Get a value of the attribute
88 set IsDone [catch {InitChildNodeIterator D ${aLabel_Root} 0} aResult]
89 if { ${IsDone} != 0 } {
91 puts "ChildNodeNext for InitChildNodeIterator Doc TreeNode AllLevels=0 : Error"
95 for {set i 1} {${i}<=10} {incr i} {
96 set aMore [ChildNodeMore]
97 set aMore [lindex ${aMore} 0]
98 if { ${aMore}=="TRUE" || ${aMore}=="TRUETRUE"} {
104 if { ${aChildNumber}!=2} {
105 puts "aChildNumber=${aChildNumber}"
106 puts "ChildNodeNext for InitChildNodeIterator Doc TreeNode AllLevels=0 : Error"
109 puts "ChildNodeNext for InitChildNodeIterator Doc TreeNode AllLevels=0 : OK"