Queue 1.1 - library
Posted: Sat Jul 10, 2004 3:30 pm
[edit]
I updated to version 1.1:
+ fixed a string-memory-hole during clean-up and dequeue/delete (strings are set to "" now)
+ added Queue_DequeueToString() - I just forgot it before. Similar to Queue_GetValToString()
(Returns a formatted string containing information on the active element of any type)
+ Change Queue Dequeue*()'s behaviour of setting the active element. It keeps now the active element
or resets the queue if it was the (previous) head. So you might mix up Queue_Next() with Queue_Dequeue()
without running into trouble.
+ added Queue_SetVal*() - functions to assign a new value of any type to the active element. (Just for
your convenience - you might further use the (faster) syntax e.g.:
*myVar.Variant_PB = Queue_GetActElement() : *myVar\l = 1234 : *myVar\type = #Long
+ added some more examples
+ added #Queue_GetResVersion = 1.1 to check against Queue_VersionInfo()
[/edit]
Hi!
I just finished the Queue-library.
These procedures give you all you need to handle dynamic data. You can use just the 'pure' queue-functionality (enqueue/dequeue) or the 'active element'-browsing for functionality same as lists. Further you can insert and delete elements anywhere inside this queue.
As elements you might use byte/word/long/float/string-values, or structures.
You can arbitrary mix them inside a queue.
You might have a look here (library and source):
http://www.2mal2mal.de/public/purebasic/libs
(Browse for the files in the subdirectory or download the self-named zip)
I updated to version 1.1:
+ fixed a string-memory-hole during clean-up and dequeue/delete (strings are set to "" now)
+ added Queue_DequeueToString() - I just forgot it before. Similar to Queue_GetValToString()
(Returns a formatted string containing information on the active element of any type)
+ Change Queue Dequeue*()'s behaviour of setting the active element. It keeps now the active element
or resets the queue if it was the (previous) head. So you might mix up Queue_Next() with Queue_Dequeue()
without running into trouble.
+ added Queue_SetVal*() - functions to assign a new value of any type to the active element. (Just for
your convenience - you might further use the (faster) syntax e.g.:
*myVar.Variant_PB = Queue_GetActElement() : *myVar\l = 1234 : *myVar\type = #Long
+ added some more examples
+ added #Queue_GetResVersion = 1.1 to check against Queue_VersionInfo()
[/edit]
Hi!
I just finished the Queue-library.
These procedures give you all you need to handle dynamic data. You can use just the 'pure' queue-functionality (enqueue/dequeue) or the 'active element'-browsing for functionality same as lists. Further you can insert and delete elements anywhere inside this queue.
As elements you might use byte/word/long/float/string-values, or structures.
You can arbitrary mix them inside a queue.
You might have a look here (library and source):
http://www.2mal2mal.de/public/purebasic/libs
(Browse for the files in the subdirectory or download the self-named zip)