Gambas Documentation
Documents

OPEN NULL

Since 3.15

Stream = OPEN NULL [ FOR [ READ ] [ WRITE ] ]

Create a "null" stream that reads and writes nothing.

  • If the READ keyword is specified, then reading is allowed. This keyword is optional, as reading is actually always allowed.

  • If the WRITE keyword is specified, then writing is allowed.

Reading on a null stream always returns "end of file".

Writing on a null stream does nothing, but advance the stream position as returned by the Seek function.

Null stream is useful for counting how many bytes you will write, without having to actually write anything anywhere.

See also