suve

awful: function: readln

Declaration

NIL :readln ( mixed &ARG , … )

Summary

Takes any number of arguments. Reads values from stdin (one value per line) and puts them into arguments received, in a left-to-right order. Numbers are read in regard to their base system. Strings read entire lines.

If any bytes are waiting in stdin buffer, the first value will be taken from buffer. If buffer is empty, or more values are to be read, the interpreter will wait until enough lines of input are fed.

Example

# Monty Python.
:set &QUEST s''
:writeln s'What... is the airspeed velocity of an unladen swallow?'
:readln &QUEST

!if :eq $QUEST s'What do you mean, an African or a European swallow?'
    :writeln s"Well... I don't know..."
    :writeln s'AAAAARRRRRRRRRRRRRRRGGGGGHHHH!!!'
    !fi

wikipage modified on 2014/0601/2317