Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 variant.pas 中,有几个 VarIsXXX( ) 函数用于对变体进行类型检查。但是,没有 VarIsBoolean()。
检查变量是否为布尔类型的首选方法是什么?
尝试
varIsType(v, varBoolean);
然后很容易编写自己的 VarIsBoolean 函数
function VarIsBoolean(const V: Variant): Boolean; begin result := varIsType(v, varBoolean); end;