Amos Professional Manual  Contents  Index

Interface Resources


Up to now, it has been explained how Interface graphics are generated using built-in Interface commands. It is also possible to create superb effects using pre-defined images stored in memory.

Each Interface program has access to a set of special resources held in an appropriate memory bank. These resources can be created with the Resource Bank Maker, which has Chapter 13.7 devoted to it. Once defined, resources can be installed for use with the AMOS Professional Interface.

The Resource Bank is normally allocated to memory bank 16, and the loading of a resources file is explained at the very end of this Chapter.

Alternatively, this process can be avoided if the current Editor settings are used. As a default, AMOS Professional provides instant access to all of the system messages and Editor objects. These provide everything needed to generate a wide variety of attractive dialogue boxes.

There are two types of resources: messages, which hold a series of button definitions and titles, and packed pictures, which can be anything at all.

MEssage Interface function: return a message from Resource Bank
message=number ME

The MEssage function takes a number from the stack and returns the appropriate message from the Resource Bank. If the value for the number of the message is out of range, an error will be generated. MEssage can be used in a PRint or PrintOutline command, like this:

E> A$="PRint 0,0,7,MEssage,5;"
   A$=A$+"EXit;"
   D=Dialog Box(A$)

A message can also be displayed directly from the main AMOS Professional program, using the RESOURCES function, which is explained later.

UNpack
Interface instruction: unpack an image from Resource Bank
UN x,y,image number;

Packed pictures can be taken from the Resource Bank, and unpacked for items such as buttons or dialogue boxes. First specify the x,y-coordinates at which the image is to be unpacked. In this case, the x-coordinate is rounded to a multiple of eight. Then specify the number of the single image to be unpacked.

E> Resource Screen Open 0,640,200,2
   A$="UNpack 10,10,13; EXit;"
   D=Dialog Box(A$)
Back    Next
09.04.01