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?
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?
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;
© 2022 - 2024 — McMap. All rights reserved.