read-tree <tree> \
( key <key> | lesser <key> | greater <key> | \
lesser-equal <key> | greater-equal <key> | \
min-key | max-key ) \
[ value [ define ] <value> ] \
[ update-value <update value> [ process-value ] ] \
[ old-key [ define ] <old key> ] \
[ status [ define ] <status> ] \
[ new-cursor [ define ] <cursor> ]
%% /tree-example
out-header default
new-tree define mytree key-as "positive integer"
int i;
for (i = 0; i < 1000000; i ++ ) {
num-string i to define key
num-string i+7 to define data
write-tree mytree key (key) value data
}
for (i = 0; i < 1000000; i ++ ) {
num-string i to define key
read-tree mytree key (key) status define st value define data
if (st != VV_OKAY){
@Could not find key <<p-out key>>
} else {
@Found data <<p-out data>> associated with key <<p-out key>>
}
delete-mem key
}
%%
You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a dofollow link back to this page - see full license at
CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind. Icons from
table-icons.io copyright Paweł Kuna, licensed under
MIT license.