suve

awful: function: read

Declaration

NIL :read ( mixed &ARG , … )

Summary

Takes any number of arguments. Reads values from stdin and puts them into arguments received, in a left-to-right order. Numbers are read in regard to their base system. Strings are read up to the first space character (or endline).

If any bytes are waiting in stdin buffer, values will be taken from the buffer. Otherwise, the interpreter will wait for a line of input to appear. Lines are left-trimmed of whitespace.

Example

# Read user data and print a greeting.
:set &NAME s''
:writeln s'What is your name?'
:read &NAME
:writeln s'Hello, ' $NAME s'!'

wikipage modified on 2014/0601/2317