< Futurebasic < Language < Reference

XREF@

Syntax

XREF@ arrayName maxSub1 maxSub2 AS dataType

Description

XREF@ is identical to the XREF statement, except that the link variable is interpreted as a handle, rather than as a pointer. You should use XREF@ when you want the contents of a relocatable block to be treated as an array.

Example

The following declares an array called inclination!, allocates a new block with enough room for numElts& elements, and associates the inclination! array with the contents of the block.

XREF@ inclination!(1)
inclination& = FN NEWHANDLE(numElts& * SIZEOF(SINGLE)

Notes

Note that, because the value of maxSub1 is ignored in the XREF@ statement, we can arbitrarily set it to 1. However, when we actually reference the elements of the inclination! array, we can specify any subscript value in the range 0 through numElts&-1.

See Also

DIM; XREF

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.