read one statement from the input stream

Parameters

 prompt - string to be used as a prompt ditto3 - value to be used for %%% ditto2 - value to be used for %% ditto1 - value to be used for %

Description

 • The function readstat reads the next statement from the input stream (the terminal or a file) and returns the value of that statement.
 • If a prompt is specified, it will be displayed.
 • If the ditto3, ditto2, and ditto1 arguments are given, they must be lists, and the values of their contents will be substituted for any occurrences of %%%, %%, and % respectively in the statement read.
 • If an incomplete statement is entered, readstat will redisplay the prompt to allow further input. This will continue until a complete statement is entered.
 • If a syntax error is discovered, readstat will produce a syntax error message, and redisplay the prompt, expecting a new statement.
 • The readstat function always reads as many entire lines as needed to parse a complete statement. If the last line contains additional characters after the end of the complete statement, a warning is generated, and the remaining input is discarded. Therefore, multiple statements per line are not permitted.

Examples

 > $x≔\mathrm{readstat}\left("x will be assigned"\right)$
 > $\mathrm{readstat}\left("Something:",\left[A\right],\left[B\right],\left[C\right]\right)$
 > $\mathrm{readstat}\left("Hello?"\right)$