Waits for the given number of bytes to be put into TeraTerm macro received buffer.

waitn <received byte count>


Pauses until the given number of bytes are received from the host, or until the timeout occurs.

If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when <timeout>.<mtimeout> seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs.

These commands return one of the following values in the system variable "result":

Value Meaning
0 Timeout. No data has received.
1 The characters of specified numbers are stored in the inputstr variable.
When the numbers are over 511 bytes, the inputstr variable truncates the numbers to 511.


; The timeout limit is 30 sec.
timeout = 30

; Clear the received buffer.

; Wait for more than 255 bytes.
waitn 255