begin-handler /list
silent-header
// Create a list
new-fifo mylist
// Add data to the list
write-fifo mylist key "key1" value "value1"
write-fifo mylist key "key2" value "value2"
start-loop
// Get data from the list
read-fifo mylist key k value v status st
// Check if no more data
if-true st not-equal GG_OKAY
break-loop
end-if
@Obtained key <<print-out k>> with value <<print-out v>>
end-loop
// Go through the list again, use rewind-fifo for that
rewind-fifo mylist
start-loop
read-fifo mylist key k value v status st
if-true st not-equal GG_OKAY
break-loop
end-if
@Again obtained key <<print-out k>> with value <<print-out v>>
end-loop
// Delete FIFO list
purge-fifo mylist
end-handler
Copied!