Amos Professional Manual  Contents  Index

AMOS Interface


SAve
Interface instruction: save background under the dialogue box
SA block number;

This is used to save the graphics defined by the previous BAse and SIze commands. The area that is saved into memory will be restored to the screen after the Interface program reaches its final EXit instruction. Give the SAve command, followed by the number of a memory block to be used for the graphics. If this has already been defined, it will be replaced by the new definition.

Note that each new control panel can save its own background area independently. Blocks will be re-drawn in reverse order when the dialogue panel is removed. If there is insufficient memory, an error will be generated when the program is initialised.

Supposing a dialogue box is to be positioned from coordinates 50,50 to 210,110. The following sequence of instructions could be used:

E> A$=A$+"BA 50,50; set the coordinate base"
   A$=A$+"SI 160,60; SA 1; save area under dialogue box"
   A$=A$+"IN 0,0,0; GB 5,5,155,56; IN 5,0,0; GB 0,0,150,50; draw a fancy box"
   A$=A$+"PO 5,10,'AMOS Professional',2,4; PR 45,20,'Basic',4; print messages"
   A$=A$+"EXit; quit interface program"
   D=Dialog Box(A$) : Wait key

Unfortunately, when that example is run, the graphics will be removed from the screen immediately after they have been drawn! This is because DIALOG BOX executes the entire Interface program in a single burst, and jumps back to the main AMOS Professional program as soon as it is completed. In order to use a dialogue box, the Interface must be instructed to wait for an event of some sort. To make that example work properly, read on!

Waiting for an event

RunUntil
Interface instruction: run until conditions are satisfied
RU delay,flags;

This command runs an Interface program from the first command, and activates all buttons and sliders that have been defined in the dialogue box. The box now waits on screen, until a specific set of conditions have been satisfied.

These conditions can be anything from pressing [Ctrl]+[C], selecting a [Quit] icon, or simply hitting a key. The requester may also be displayed for a specific amount of time. If the original screen contents have been saved using the SAve command, they will be restored to normal as soon as the program returns to AMOS Professional Basic.

The RunUntil command is ideal for use with dialogue boxes that do not need to interact with the main AMOS Professional program.

Back    Next
09.01.08