Skip to content

Commit

Permalink
Update ckeyon.rst
Browse files Browse the repository at this point in the history
Noe 2 added on behalf of PJW.
  • Loading branch information
NormanDunbar committed Feb 6, 2022
1 parent b72e22b commit e69445f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion sphinx/source/C/ckeyon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CKEYON
======

+----------+-------------------------------------------------------------------+
| Syntax | CKEYON |
| Syntax | CKEYON [#channel] |
+----------+-------------------------------------------------------------------+
| Location | Pointer Interface (v1.23 or later) |
+----------+-------------------------------------------------------------------+
Expand All @@ -15,3 +15,28 @@ See :ref:`ckeyoff`.

There were problems with this command prior to v1.56.

**Note 2**

At some point CKEYON started to have to take a channel number, ie
CKEYON #channel.

If you dont give a
channel number the commands try to open their own channel - that hybrid
number 0/1, as do a number of IO commands (at least in SMSQ/E). All well
and good. But if you, say, open your first channel as number 3, as happens
automatically if your first channel in a daughter SBASIC or Qlib compiled
job, and you open it with ch = FOPEN("con_") then, if that channel is
OUTLiNed to be smaller than the default channel, the call fails and returns
to the routine - which gives up. But doesnt say anything! However, now
there is dangling, open channel in the main channel table that SBASIC
doesnt know about. So next time you use this command yet another channel is
opened in the main channel table! And so it goes on ad finitum until the
job is killed - or the system chokes.

This is a rare circumstance, admittedly, but it is still a bug.


The bug fix is that
if the circumstances described pertain, the call will return with an Out of
Range error.

0 comments on commit e69445f

Please sign in to comment.