[Contents] · [Home] · [Mail]

SALIERI Language - read

Type:
read: promptString -> object

Call syntax:
read(prompt)

Description:
read displays the prompt string prompt and waits for the user to type in a SALIERI expression. The input is terminated by hitting the Enter-key. The user input is then evaluated as a SALIERI expression and the resulting value of this is returned as the result of read. For reading in strings, the function readStr should be used.

Attention!
The automatic evaluation of expressions entered using read can cause objects in the current workspace to be modified or deleted.

Error conditions:
Error conditions arise, when the input string is no valid SALIERI expression or contains undefined identifiers.

Example:
> read("->")
->12
Result= 12
> read("->")
->12+2*3
Result= 18
> read("->")
->"hallo"
Result= "hallo"
> read("->")
->12a
Error in command-line:
parse error
(occured while executing function "read")
> a := read("->")
->notDefined
Error in command-line:
Unknown identifier: notDefined
(occured while executing function "read")
> write(a)
Error in command-line:
Unknown identifier: a
(occured while executing function "write")

See also: readStr


[Contents] · [Home] · [Mail]
© sic!systems, page frame designed by hh; this page has been automatically generated from the SALIERI Documentation Database.