Question

In variants.pas, there is several VarIsXXX( )-functions for type-checking a variant. There is no VarIsBoolean( ), though.

What's your preferred way of checking if a variant is of type boolean?

Was it helpful?

Solution

Try

varIsType(v, varBoolean);

It is easy then to write your own VarIsBoolean function

function VarIsBoolean(const V: Variant): Boolean;
begin
   result := varIsType(v, varBoolean);
end;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top