2 # Tree construction attributes
4 # Testing attribute: TDataStd_TreeNode
6 # Testing command: PrependNode
8 # Testing command: SetNode
9 # Testing command: AppendNode
10 # Testing command: ChildNodeIterate
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 SetNode D ${aLabel_Root}
41 AppendNode D ${aLabel_Root} ${aChild1}
42 PrependNode D ${aLabel_Root} ${aChild2}
43 PrependNode D ${aLabel_Root} ${aChild3}
45 # Close/Open the transaction
48 # Forget the attribute
49 ForgetAll D ${aLabel_Root}
51 # Close/Open the transaction
59 # Get a value of the attribute
60 set IsDone [catch {set aListChildNodes [ChildNodeIterate D ${aLabel_Root} 1]} aResult]
61 if { ${IsDone} != 0 } {
63 puts "Prepend TDataStd_TreeNode attribute: Error"
66 set aListChildNodesLength [llength ${aListChildNodes}]
67 if { ${aListChildNodesLength}!=[expr 3 + 0]} {
68 puts "aListChildNodes=${aListChildNodes}"
69 puts "aListChildNodesLength=${aListChildNodesLength}"
70 puts "Prepend TDataStd_TreeNode attribute: Error"
74 puts "Prepend TDataStd_TreeNode attribute: OK"