202 of 286
188 PutQueueStr Type Subroutine Invocation PutQueueStr(queue, str) Parameter Method Type Description queue ByRef array of Byte The queue to which to write data. str ByVal String The string to be written to the queue. Discussion This routine writes the characters from the string to the specified queue. If there is insufficient space in the queue, the calling task will suspend until space becomes available. Note, particularly, that no data will be written until there is room for all the data to be written. This has two important ramifications. Firstly, if the number of bytes to be written is larger than the data capacity of the queue, the write will never complete. Secondly, if data is never taken out of the queue thus making room for the additional data, the write will also never complete. Note that before any queue operations are performed, the queue data structure must be initialized. See the discussion of OpenQueue() for more details. Example Dim outQueue(1 to 40) as Byte Call OpenQueue(outQueue, SizeOf(outQueue)) Call PutQueueStr(outQueue, "Hello, world!") Compatibility BasicX allows any type for the first parameter. This implementation requires that it be an array of Byte. See Also PutQueueByte, PutQueue, OpenQueue