Creating a Window
The most frequently used method of creating a window is the 'WINDOW' mnemonic. This mnemonic will accept from 4 to 6 arguments in the following format:
PRINT 'WINDOW'(5,10,40,10,"TITLE",'BR'),
NOTE: A "title string" cannot contain embedded mnemonics.
This would create a new window starting at column 5, line 10 on the screen and containing a border (in reverse video, if the terminal supports it) with the title "TITLE". The displayable region would start at column 6, line 11 and be 38 characters wide by 8 lines long (the border occupies one character all the way around the window). All references to the display region within the window are zero relative, where the home (0,0) position is the upper-left corner of the new scroll region.
A newly created window contains a copy of the text that it covers. Normal operation at this point would be to print a 'CS' mnemonic to clear the window display region, and to display the information desired in the window. However, it is possible to continue normal operations without clearing the text that is in the new window. Also copied are:
-
Current and default colors and attributes
-
Current and default scrolling, wrapping and protect modes
-
Current function and key edit loads
Changing the colors, attributes or modes will not change them in the old window. It will only change the copy in the new window.
If you attempt to create a window needing more memory than is available, an !ERROR=33 will result.
An alternate method of creating a window is the 'PUSH' mnemonic. This creates a copy of the current window and makes the new window the active window. This is frequently used as a way of saving the current screen prior to executing a function that will change the display in an unknown fashion. If the display modifications are being made outside PRO/5 control then an 'RS' mnemonic must be used. The 'POP' assumes the state of the display whereas the 'RS' mnemonic assumes nothing about the display.