%% /tree-example public
new-tree mytree key-as "positive integer" // create new tree
set-number i
start-loop use i start-with 0 repeat 1000000
number-string i to key
set-string data=key
write-tree mytree key (key) value data // insert key/data to the tree
end-loop
start-loop use i start-with 0 repeat 1000000
number-string i to key
// search tree for each key previously inserted
read-tree mytree equal (key) status st value data
if-true st not-equal GG_OKAY
@Could not find key <<print-out key>>
else-if
@Found data <<print-out data>> associated with key <<print-out key>>
end-if
delete-string key
end-loop
%%
Copied!