Passing arrays

Each array in your program has an associated array descriptor.  This descriptor is saved in a proprietary format, which may change from version to version of PowerBASIC.  Since most of the information in the descriptor in not relevant to assembler code, it is usually best to simply pass a pointer  to the first element of the array instead.  You can use the VARPTR function to retrieve that address.  Subsequent elements of the array will immediately follow the first in memory, while multi-dimensional arrays are stored in column-major order.

In addition to the LBOUND and UBOUND functions, the ARRAYATTR function can be used to obtain array attributes and information on a given array.

 

See Also

The Inline Assembler

Passing parameters

Parameters passed by reference or by copy

Parameters passed by value

Passing dynamic strings

Accessing PowerBASIC variables by name