63 of 323
ZBasic System Library 53 ZX Microcontroller Family Console.Read Type Function returning Byte Invocation Console.Read() Discussion This function can be invoked to retrieve a character from the input queue associated with Com1 (by default, but see Option Console in the ZBasic Language Reference Manual). If the value of Register.Console.Echo is True, the character will automatically be sent back out via the output queue associated with the designated serial channel. When this function is called it will not return until a character is available. However, other tasks will continue to execute. You may wish to query the designated queue to find out if there are characters available before calling this function. See the example below. Example Dim b as Byte b = Console.Read() ' this will wait until a character is available If (GetQueueCount(CByteArray(Register.RxQueue)) > 0) Then b = Console.Read() ' read the next available character End If Compatibility This function is not available in BasicX compatibility mode. See Also Console.ReadLine, Console.Write, Console.WriteLine