Some more problems with CLRSCRN

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Some more problems with CLRSCRN

Hercules390 - Vm mailing list
Hello VM/CMS experts,

now that I have solved the first problem with CLRSCRN
(generating a module for the transient area), I have yet another
problem using it with my Pascal programs.

First, the problem was, that the Pascal Terminal I/O
(done by QSAM-Macros DCB and GET, OS simulation and
FILEDEF TERM) showed EOF (that is, branched to the EODAD address),
when I entered an empty line from the CMS console. I fixed this
by simply ignoring the EOF and supplying a default (empty) buffer
in this case. It works; when I continue GETting more lines, I really
get them (Locate Mode, RECFM = V, BTW).

Now the second problem:

at certain points of the application, the CLRSCRN calls
should clear the screen, then some sort of menu is printed using
Pascal WRITELN functions, then some input is required from the user.
Because all this fits on one screen, the user never has to clear the screen
himself, and so a sort of "cheap" user dialog can be established, without
needing tools like DMS/PANEL or ISPF.

This worked very well in the 1980s (with Pascal/VS) and was accepted
by the customers then. I would like to try to run the programs again
using the Stanford compiler.

The problem is: the CLRSCRN calls are not synchronized properly with
the Pascal Terminal I/O, that is: the screen is cleared not at the desired
time, but sometimes later, so some output is not visible to the user,
when he or she is supposed to do the input, because the CLRSCRN action
came too late.

Maybe the problem is related to some sort of QSAM buffering ...
don't know - the internal FILEDEF generated by the Pascal TERMIN function
looks like this:

CMSCMD := 'FILEDEF XXXXXXXX TERM (RECFM V LRECL 255 #' ;

Do you have any idea or suggestion, how I can change this behaviour?

Would it be, for example, better, if I change the Pascal Terminal I/O to
other methods? If I recall, there are CMS functions RDTERM and WRTERM
to read and write output to the screen. Will the problem disappear,
if I switch to these functions? This would be no big deal, because the
Pascal TERMIN and TERMOUT functions already set a "terminal" switch
in the Pascal FCB, so that I can make some actions depending on this switch
(like the EOF handling mentioned above).

I don't want to do a 3270-style output, at the moment, first because that
would affect to program logic massively, and second, because the programs
using this simple technique will run on Windows etc, too; CLRSCRN is done
by a system call to the Windows cmd "CLS" there - no problem at all.

Thank you for your help,
kind regards

Bernd


Reply | Threaded
Open this post in threaded view
|

Re: Some more problems with CLRSCRN

Hercules390 - Vm mailing list
Hello,

I would like to keep you informed that issuing a WAITT
macro call just before the CLRSCRN call did the trick.

This way CLRSCRN waits for the Pascal terminal output to be completed,
before it cleans the screen. Now the application behaves as desired.

The CLRSCRN function now looks like this; it works for both VM/CMS
and Windows:

procedure CLRSCRN ;

(**************************************)
(*   LOESCHT DEN BILDSCHIRM MITTELS   *)
(*   CMS-KOMMANDO CLRSCRN.            *)
(**************************************)

    var RC : INTEGER ;
        CMD : array [ 1 .. 80 ] of CHAR ;
        X : VOIDPTR ;

    begin (* CLRSCRN *)
      if ORD ( '0' ) <> 0X30 then
        begin
          X := $PASSYS ( 13 , NIL ) ;   /* = WAITT macro call */
          CMD := 'CLRSCRN #' ;
          CMSX ( ADDR ( CMD ) , RC ) ;
        end (* then *)
      else
        begin
          CMD := 'CLS #' ;
          WINX ( ADDR ( CMD ) , RC ) ;
        end (* else *)
    end (* CLRSCRN *) ;

Thank you all,
have a nice day

Bernd



Am 06.03.2017 um 12:38 schrieb Bernd Oppolzer:

> Hello VM/CMS experts,
>
> ...
>
> The problem is: the CLRSCRN calls are not synchronized properly with
> the Pascal Terminal I/O, that is: the screen is cleared not at the
> desired
> time, but sometimes later, so some output is not visible to the user,
> when he or she is supposed to do the input, because the CLRSCRN action
> came too late.
>
> Maybe the problem is related to some sort of QSAM buffering ...
> don't know - the internal FILEDEF generated by the Pascal TERMIN function
> looks like this:
>
> CMSCMD := 'FILEDEF XXXXXXXX TERM (RECFM V LRECL 255 #' ;
>
> Do you have any idea or suggestion, how I can change this behaviour?
>
> Would it be, for example, better, if I change the Pascal Terminal I/O to
> other methods? If I recall, there are CMS functions RDTERM and WRTERM
> to read and write output to the screen. Will the problem disappear,
> if I switch to these functions? This would be no big deal, because the
> Pascal TERMIN and TERMOUT functions already set a "terminal" switch
> in the Pascal FCB, so that I can make some actions depending on this
> switch
> (like the EOF handling mentioned above).
>