new-list mylist
// Add data to the list
write-list mylist key "key1" value "value1"
write-list mylist key "key2" value "value2"
write-list mylist key "key3" value "value3"
position-list mylist last
start-loop
// Get data from the list starting with the last one, producing value1, value2, value3
read-list mylist key k value v
@Obtained key <<print-out k>> with value <<print-out v>>
position-list mylist previous status s
// Check if no more data
if-true s equal GG_ERR_EXIST
break-loop
end-if
end-loop
// Now the list is positioned at the first element, reading produces value3, value2, value1
start-loop
read-list mylist key k value v status s
if-true s equal GG_ERR_EXIST
break-loop
end-if
@Again obtained key <<print-out k>> with value <<print-out v>>
position-list mylist next
end-loop
purge-list mylist
Copied!