Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: No VarIsBoolean( )-function?

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?

like image 915
Vegar Avatar asked Jun 12 '09 10:06

Vegar


1 Answers

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;
like image 178
Ralph M. Rickenbach Avatar answered Sep 20 '22 23:09

Ralph M. Rickenbach