Manipulating windows
WINDON
function: return the value of the current window
w=Windon
Before using windows in your programs, you will need to refer to their identification numbers. This function returns the value of the current window. For example:
E> Do Cls : Wind Open Rnd(99)+1,1,1,25,5,1 Print "Window number ";Windon : Wait Key Loop
WIND SAVE
instruction: save the contents of the current window
Wind Save
This command is extremely valuable for the AMOS Professional programmer. Once activated, the WIND SAVE feature allows you to move your windows anywhere on screen without corrupting the existing display, by the following method. The contents of the current window is saved as soon as the command is used, and then every time a new window is opened, the contents of the windows underneath get saved automatically. The screen is then re-drawn whenever a window is moved to a new position or closed.
As you begin a new program, the current window (the default screen) consumes 32k of valuable memory, and this would be wasted if you were to save it as background beneath a small dialogue box. To solve this problem, create a dummy window of the size you need, and place it over the zone you want to save. Now execute your WIND SAVE command and continue with your program. When this dialogue box is called up, the area beneath it will be saved as part of your dummy window, so it will automatically be restored after your box has been removed.
WIND CLOSE
instruction: close the current window
Wind Close
The WIND CLOSE command deletes the current window. If the WIND SAVE command has been activated, the deleted window will be replaced by the saved graphics, otherwise the area will be totally erased from the screen. Here is an example:
E> Wind Open 1,1,8,35,18,1 : Print "Press a key to close this window" Wait Key Wind Close
WIND MOVE
instruction: move the current window
Wind Move x,y