Amos Professional Manual  Contents  Index

Procedures


used to mean "match this with any list of characters in the variable name, until the next control character is reached", and the ? character means "match this with any single character in the variable name". So the next line would define every variable as global:

X> Global "*"

Now look at the following example:

X> Shared A,"V*","VAR*END","A?0S*"

That line would declare the following variables as shared:

GLOBAL or SHARED should be employed before the first use of the variable, otherwise it will have no effect on an interpreted program, although it will affect programs compiled with the AMOS Professional Compiler.

Only strings may be used for this technique. Global and shared arrays cannot be defined using wild cards. These must be defined individually, using brackets. Also, if you try to use an expression in this way, an error will be generated.
For example:

X> A$="AM*"
   Global A$

In that case, the A$ variable would be regarded as global, and it would not be taken as a wild card for subsequent use.

With AMOS Professional, you are able to define global arrays from a procedure, even if the array is not created at root level, as follows:

X> Procedure VARIABLES
   Dim ARRAY(100,100)
   Global ARRAY()
   End Proc

Returning values from a procedure
If you want to return a parameter from inside a procedure, that is to say, if you need to send back a value from a local parameter, you need a way of telling your main program where to find this local variable.

Back    Next
05.05.07