We'll dive straight in with this first example, and define an object and use it. Object definitions are global and must be made before any procedure definitions.
OBJECT rec tag, check table:ARRAY data:LONG ENDOBJECT PROC main() DEF a:rec a.tag:=1 a.check:=a a.data:=a.tag+(10000*a.tag) ENDPROC
This program doesn't visibly do anything so there isn't much point in compiling it. What it does do, however, is show how a typical object is defined and how elements of an object are selected.
The object being defined in the example is
rec, and its elements are defined just like variable declarations (but without a
There can be as many lines of element definitions as you like between the
ENDOBJECT lines, and each line can contain any number of elements separated by commas.
The elements of the
rec object are
check (which are
table (which is an array of
CHAR with eight elements) and
data (which is also
Every variable of
rec object type will have space reserved for each of these elements.
The declaration of the (local) variable
a therefore reserves enough memory for one
Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.