Click or drag to resize

ALen Function (FoxArray, Long)

X#
Returns the number of elements, rows, or columns in an array.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION ALen(
	a AS FOXARRAY,
	nArrayAttribute AS LONG
) AS DWORD
Request Example View Source

Parameters

a
Type: FoxArray
nArrayAttribute
Type: Long
Determines whether ALEN( ) returns the number of elements, rows or columns in the array according to the following values for nArrayAttribute: 0 Returns the number of elements in the array. Omitting nArrayAttribute is identical to specifying 0. 1 Returns the number of rows in the array. 2 Returns the number of columns in the array. If the array is a one-dimensional array, ALEN( ) returns 0 (no columns).

Return Value

Type: DWord
Numeric
Examples
X#
 1CLEAR
 2=AFONT(gaFontArray)  // Array containing font names
 3gnNumFonts= ALEN(gaFontArray)  // Number of fonts
 4IF gnNumFonts > 10
 5gnNumFonts = 10  // Display first 10 fonts
 6ENDIF
 7FOR nCount = 1 TO gnNumFonts
 8? ALLTRIM(gaFontArray(nCount))  // Display font name
 9?? '  This is an example of ' ;
10+ ALLTRIM(gaFontArray(nCount)) FONT gaFontArray(nCount), 8
11ENDFOR
See Also