Page 272 of 346 Start Back Next End ZBasic System Library 260 ZBasic Microcontrollers SearchQueue Type Function returning UnsignedInteger Invocation SearchQueue(queue, val) SearchQueue(queue, dataLen, data) Parameter Method Type Description queue ByRef array of Byte The queue of interest. val ByVal Byte The byte value for which to search. dataLen ByVal Integral The length of the byte sequence for which to search. data ByRef Any type The byte sequence for which to search. Discussion This function searches the data in a queue looking for the specified byte value (first form) or a sequence of bytes (second form). If the queue is empty or does not contain the byte value/byte sequence, zero is returned. Otherwise, the return value indicates the number of bytes in the queue up to and including the sought byte value/byte sequence. Note that before any queue operations are performed, the queue data structure must be initialized. See the discussion of OpenQueue() for more details. Examples Dim q(1 to 40) as Byte Dim data(1 to 4) as Byte Dim dataLen as UnsignedInteger ' search for a byte value (linefeed) dataLen = SearchQueue(q, &H0a) ' search for a byte sequence (carriage return, linefeed) data(1) = &H0d data(2) = &H0a dataLen = SearchQueue(q, 2, data) Compatibility This function is not available on ZX models that are based on the ATmega32 processor (e.g. the ZX-24). Moreover, it is not available in BasicX compatibility mode. See Also GetQueue, GetQueueStr, OpenQueue