FBWiki : KeyPgOpArrayIndex

FBWiki :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Operator () (Array index)


Returns a reference to an element in an array

Syntax:
declare operator () ( lhs() as T, byref rhs as integer, ... ) as T


Usage:
result = lhs ( rhs [, ...] )

Parameters:
lhs
An array.
rhs
An index of an element in the array.
T
Any data type.

Description:
This operator returns a reference to an element in an array. For multidimensional arrays, multiple indexes must be specified (up to the total number of dimensions of the array).

For any one dimension d in array a, any index outside of the range (Lbound(a(), d), Ubound(a(), d)) will result in a runtime error.

Examples:

Dim array(4) As Integer = { 0, 1, 2, 3, 4 }

For index As Integer = 0 To 4
    Print array(index)
Next

will produce the output:

	0 1 2 3 4


Differences from QB:

See also:

Back to Indexing Operators
Back to Operators

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0



sf.net phatcode