Delphi: No VarIsBoolean( )-function?
Asked Answered
L

1

7

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?

Linoel answered 12/6, 2009 at 10:53 Comment(0)
W
20

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;
Whipstall answered 12/6, 2009 at 10:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.