Two little questions

Product/components used and version/fix level:

NAT228

  1. Why does %H delete empty lines?
  2. How to stop displaying using pf-keys?
    For example, after pressing the f3 key the screen does not clear, and one line remains on top of the screen:
* report mode                        
#A(A10) = '1234567890'        
SET KEY PF3               
FOR I(N2) = 1 TO 98       
WRITE NOTITLE #A 
IF *PF-KEY = 'PF3'  THEN DO      
  ESCAPE BOTTOM             
DOEND                     
LOOP                      
.                         

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 :wink:
You can switch off display of PF keys with SET KEY OFF (see documentation)
FInn

1 Like

SET KEY OFF does not only deactivate the displaying, it deactivates the keys too.

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
1 Like

A little trick here that I think is even easier than Ralph’s :wink:
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
.

1 Like

Regarding %H, are you seeing the result on a printer, or in a SYSOUT file? If SYSOUT, have you checked for ASA characters?

My results may be different because I’m running Natural for Windows 9.3, but I see blank lines in my output.

%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.

Are blank lines being replaced with ASA characters - and 0? That would be SAG trying to produce more efficient output.

My test sent the output to SOURCE, where I saw blank lines.

Yes, if i am using NAT228 and %HL or NAT316 with parameter HCAM=STD and ‘FILEDEF CMHCOPY DISK fn ft fm’.