NAME

readstr - reads a string from a file

SYNOPSIS

file.readstr()

DESCRIPTION

Reads UTF-8 characters from the specified file until end-of-line (or until an imnplementation-defined maximum number of characters has been read). If the optional file is not specified, reads from io::Input. Unread characters remain buffered by the operating system.

RETURN VALUE

A String or WideString is returned, depending on whether any characters with encoding greater than 127 were read.

ERRORS

EndOfFile if there are no more characters to be read from the given file
UTF8Check if an illegal UTF-8 byte is read from a text-mode file

EXAMPLE

    proc main()
    {
        try {
            while (true) {
                var str = readstr();
                "", str, '\n';
            }
        }
        catch (e) {
            "", e, '\n';
        }
    }

SEE ALSO

getchar
new File
putchar
read