Channel toolkit

Toolkit with various wrappers for SMSQ/E I/O traps. Free to use, please just give some credit.
Parameters in square brackets are optional.

©2006 Marcel Kilgus

CHAN_BASE

Syntax: base = CHAN_BASE([#ch])

Returns the address of the channel definition block.

IOF_POSA

Syntax: pos = IOF_POSA([#ch,] pos)

Move file pointer to given absolute position. Returns the actually set position
afterwards.

IOF_POSR

Syntax: pos = IOF_POSR([#ch,] relpos)

Move file pointer relative to current position. Returns the actually set
position afterwards.

IOF_RHDR

Syntax: h$ = IOF_RHDR([#ch])

Returns the file header.

IOF_SHDR

Syntax: len = IOF_SHDR([#ch,] h$)

Sets the file header of the channel. Returns the amount of bytes set.

IOB_FLIN

Syntax: IOB_FLIN([#ch,] s$[, timeout])

Fetches a line, ending with LF, into the string s$. Optionally a timeout can
be provided, otherwise the default is -1, meaning forever. This call is similar
to INPUT, it does however return the raw string, including the terminating LF
character.

IOB_FMUL

Syntax: IOB_FMUL([#ch,] s$, len[, timeout])

Reads a fixed number of bytes from the channel into the string s$. Optionally a
timeout can be provided, otherwise the default is -1, meaning forever.