Hi Evgen
I think you just discovered the - somewhat confusing - feature of Natural called the âPage Bufferâ.
The logic is that it build up the screen content, and when it discovers that there is no longer room on the screen i.e. has a line that will not fit, it displays the screen.
The consequence is that when you chose to stop the listing (with PF3 etc) there is one line left that Natural feels obliged to present.
Try adding you counter variable I to the Write statement
WRITE NOTITLE #A I
And you will notice that it is a new line
You can switch off display of PF keys with SET KEY OFF (see documentation)
FInn
Here is a solution to your PFkey problem. Itâs an INPUT statement within AT END OF PAGE. Also, I have included a test to allow for batch or on-line execution.
I suggest you use structured mode for everything, even ad hocs like this.
* EOP
FORMAT PS=15
#A(A10) = '1234567890'
#BATCH (A8) = *DEVICE
RESET #EOP (A2)
*
SET KEY PF3
FOR I(N2) = 1 TO 98
WRITE NOTITLE *PAGE-NUMBER *LINE-COUNT #BATCH #A
IF *PF-KEY = 'PF3' THEN DO
ESCAPE BOTTOM
DOEND
*
AT END OF PAGE
IF #BATCH <> "BATCH"
THEN
INPUT / 'To terminate report, press PF3 or enter non-blank' #EOP
IF #EOP <> ' '
THEN
ESCAPE BOTTOM
LOOP
END
A little trick here that I think is even easier than Ralphâs
Add the terminal command âNâ to suppress the next input statement (i.e. the screen with the single line that needs you to acknowledge)
#A(A10) = â1234567890â
SET KEY PF3
FOR I(N2) = 1 TO 98
WRITE NOTITLE #A I
IF *PF-KEY = âPF3â THEN DO SET CONTROL âNâ
ESCAPE BOTTOM
DOEND
LOOP
.
%H sends result to a virtual printer, to a spool file. In older versions (2.1.7, 1.2) this commnad doesnât delete empty lines. But CMPRTnn DATASETS has correct ASA charcters. And DEFINE PRINTER OUTPUT âHARDCOPYâ doesnât delete empty lines.