Section One BBS

Welcome, Guest.


Subject: Issue with MPL script Date: Fri Jan 07 2022 07:34 pm
From: LEE WESTLAKE To: All

Hi all,

I'm currently having a play around with MPL scripts (A46 Win32) and appear to
have run into an issue regarding the 'KeyPressed/ReadKey' functions in the
following code:

----------

var gExitFlag : boolean;
var gCount : integer;

begin
  gExitFlag := false;
  repeat
    write('|[X00|[Y00' + int2str(gCount));
    gCount := gCount + 1;
    if (keypressed()) then
      begin
        if ('q' = readkey()) then
          gExitFlag := true;
      end
  until gExitFlag = true;
end.

----------

The code appears to run as expected when I connect via syncterm, but the
netrunner client appears to send a periodic heartbeat code which forces
the KeyPressed function to return 'true'. I'm not sure which code netrunner
is sendind, but it appears to stall the subsequent call to ReadKey - pressing
a key allows the script to continue until the next heartbeat code is sent.

Most of this is largely supposition, but perhaps the heartbeat code is
fooling ReadKey into waiting for a multi-byte sequence? Failing that, perhaps
there's an error in the script somewhere?

Any help and/or advice would be greatly appreciated.

            o-----------o------------o-------------------------o
  TALIADON  |  2:250/6  |  21:3/138  |  TALIADON-BBS@MAIL.COM  |
o-----------o-----------o------------o-------------------------o
| "Error is a great teacher, and humility its hardest lesson." |
o--------------------------------------------------------------o
--- Mystic BBS v1.12 A46 2020/08/26 (Windows/32)
 * Origin: TALIADON BBS (2:250/6)

Previous Message       Next Message
Replies: Re: Issue with MPL script (g00r00)