The order of a Qeue Data Structure is First In First Out (FIFO). Use the stack collection for Last In Last Out (LILO) if you need to have access to the last element.
You can also try the List and Map samples from derez.
It may be nice to have a List in B4R, so here is one, quite primitive. The module is a code module so it enables use of one list. If you need more - copy the module and change its name. The array defined in the module has a fixed size which must be set prior to compilation by literals. Sorting...
It may be nice to have a map in B4R, so here is one, quite primitive. The module is a code module so it enables use of one map. If you need more - copy the module and change its name. The arrays defined in the module have a fixed size which must be set prior to compilation by literals.