Futurebasic/Language/Reference/xrefat

From Wikibooks, open books for an open world
Jump to navigation Jump to search

XREF@[edit | edit source]

Syntax[edit | edit source]

XREF@ arrayName maxSub1 maxSub2 AS dataType

Description[edit | edit source]

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[edit | edit source]

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[edit | edit source]

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[edit | edit source]

DIM; XREF