Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.25 KB

chanid.rst

File metadata and controls

42 lines (30 loc) · 1.25 KB

CHANID

Syntax

CHANID [(#ch)]Btool only or

CHANID (#ch)TinyToolkit

Location BTool, TinyToolkit

QDOS uses a different sort of channel number internally to those used by SuperBASIC. These so-called channel IDs have the advantage that two channels will never have the same channel ID, even if some channels have been closed for a long time.

The function CHANID expects an open SuperBASIC channel #ch (a default channel of #1 is allowed by Btool) and returns its current internal channel ID.

Example

100 OPEN#3,con_2x1
110 PRINT CHANID(#3)
120 CLOSE#3: OPEN#3,con_2x1
130 PRINT CHANID(#3)
140 CLOSE#3

CROSS-REFERENCE

chanid is intended for use with file-open.

channel-id is the same as the Btool variant.

See SET_CHANNEL also.