Click or drag to resize

AElement Function (FoxArray, DWord, DWord)

X#
Returns the number of an array element from the element's subscripts.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION AElement(
	ArrayName AS FOXARRAY,
	nRowSubscript AS DWORD,
	nColumnSubscript AS DWORD
) AS USUAL
Request Example View Source

Parameters

ArrayName
Type: FoxArray
Specifies the name of the array whose element number you want to return.
nRowSubscript
Type: DWord
nColumnSubscript
Type: DWord

Return Value

Type: Usual
Remarks
You can refer to an element in a two-dimensional array in one of two ways. The first method uses two subscripts to specify the row and column position of the element in the array, and the second method uses a single-element number. AELEMENT( ) returns the element number when supplied with an element's row and column subscripts. The functions ADEL( ), ADIR( ), AFIELDS( ), AINS( ), ALEN( ), ASCAN( ), ASORT( ), and ASUBSCRIPT( ) can manipulate two-dimensional arrays and require that elements be referred to by their element number. AELEMENT( ) facilitates conversion from subscripts to an element number for use by these functions. The corresponding row and column subscripts can be returned from an element number with ASUBSCRIPT( ).
X#
1DIMENSION gaMyArray(2,3)
An element can be referred to by its subscripts or its element number. The commands STORE 'INVOICE' TO gaMyArray(2, 1) and STORE 'INVOICE' TO gaMyArray(4) both store the character string INVOICE to the same array element. In one-dimensional arrays, an element number is identical to its single-row subscript. It isn't necessary to use AELEMENT( ) with one-dimensional arrays.
See Also