Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
28
Task/Queue-Usage/FreeBASIC/queue-usage.basic
Normal file
28
Task/Queue-Usage/FreeBASIC/queue-usage.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
#Include "queue_rosetta.bi" '' include macro-based generic Queue type used in earlier task
|
||||
|
||||
Declare_Queue(String) '' expand Queue type for Strings
|
||||
|
||||
Dim stringQueue As Queue(String)
|
||||
With stringQueue '' push some strings into the Queue
|
||||
.push("first")
|
||||
.push("second")
|
||||
.push("third")
|
||||
.push("fourth")
|
||||
.push("fifth")
|
||||
End With
|
||||
Print "Number of Strings in the Queue :" ; stringQueue.count
|
||||
Print "Capacity of string Queue :" ; stringQueue.capacity
|
||||
Print
|
||||
' now pop them
|
||||
While Not stringQueue.empty
|
||||
Print stringQueue.pop(); " popped"
|
||||
Wend
|
||||
Print
|
||||
Print "Number of Strings in the Queue :" ; stringQueue.count
|
||||
Print "Capacity of string Queue :" ; stringQueue.capacity '' capacity should be unchanged
|
||||
Print "Is Queue empty now : "; stringQueue.empty
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue