Hi,
could you please let me know what the following means?
Dim szWarData() As Variant
ReDim szWarData(ntRow + 1, 10)
What does Variant mean?
Please let me know. Thanks.
Hi,
could you please let me know what the following means?
Dim szWarData() As Variant
ReDim szWarData(ntRow + 1, 10)
What does Variant mean?
Please let me know. Thanks.
A 'Variant' is a type of variable declaration just like 'Integer' or
'String'. The difference is that a variant may store data of an
unspecified format i.e. not just whole numbers or not just a block of
text.
In fact you can't compare a Variant just with an Integer or a String...
OK, it stands also for a specific type, the "Variant"-type but that's
just the thing : if you don't know exactly what type you need you can
just take the Variant as a black box... the Variant has a big fitt for
all kinds of variables, but at the same time you have to be carefull
with it...
In your example : Dim szWarData() As Variant
szWarData() is in fact the definition of a dynamic array (meaning it's
not fixed, it can be changed) of the Variant type (note: if you don't
define the type exactly, the system assumes it's a Variant-type)
Now in you next statement : ReDim szWarData(ntRow + 1, 10)
you give the variable szWarData the dimensions ntRow+1 and 10...
To learn more about this you should look into the subjects : Arrays,
Dynamic Arrays, Redim, Erase, UBound and LBound...
Good Luck
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks