Returns or sets the specified variant number of dimensions.
[ lCount = ] VarDimCount (pv[, lDimCount])
The VarDimCount procedure syntax has the following parts:
Name |
Type |
Description |
lCount |
Long |
Number of dimensions of the array |
lDimCount |
Long |
v10. Number of dimensions to set. Use 0 to remove the array. 1 for 1 dimension array, etc. |
pv |
Var Variant |
A Variant |
Returns the number of dimensions that variant data has, if that data is an array. If the data in the given Variant is not an array, then this procedure returns 0.
! For example, vA is a Variant and anArray is a 4 Short
anArray={1, 2, 3, 4}
vA=anArray ! assign and set the array
print VarDimCount(vA) ! prints 1
print VarDimSize(vA, 1) ! prints 4 (v10)
print vA[2] ! prints 3
VarDimCount(vA, 0) ! remove array (v10)
print vA ! print 0 since the array cleared