Peter Laman wrote:
> A method I'm writing takes a variant as its argument, which MUST be a
> variant of varVariant. In other words, it must be created with
> VarArrayCreate([0, max], varVariant). How can I validate this? I haven't
> found a way yet to obtain the base type of a variant array yet. All I seem
> to be able to check is VarIsArray, but that only tells me the variant is an
> array, but not what the base type is.

Use the VarType function. It will tell you not only the that the Variant 
is an array, but also the base type. If the base type is VarSingle, then 
VarType will return the value of (varSingle or varArray).

Assert(VarIsArray(X));
Assert((VarType(X) and varTypeMask) = varSingle);

or

Assert(VarIsType(X, varArray or varSingle));

-- 
Rob
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to