Variant.IsEmpty 和 Variant.IsNull 有什么区别?
What is the difference between Variant.IsEmpty and Variant.IsNull?
根据帮助(IsEmpty, IsNull),都return true
if the VType field of the TVarData base class is varEmpty
我不知道这两种方法之间是否存在细微差别,或者哪一种是 best/correct 检查 Variant 值是否有任何数据的方法。
通常 Null 表示缺失或未知数据。 Empty表示没有数据。
想想 phone 数字字段。如果您根本不知道某人是否有电话 phone 号码,则该字段应为 Null。如果您知道某人没有电话phone,那么该字段应该是空。
不管文档怎么说,IsEmpty
检查值 varEmpty
和 IsNull
检查值 varNull
.
根据帮助(IsEmpty, IsNull),都return true
if the VType field of the TVarData base class is varEmpty
我不知道这两种方法之间是否存在细微差别,或者哪一种是 best/correct 检查 Variant 值是否有任何数据的方法。
通常 Null 表示缺失或未知数据。 Empty表示没有数据。
想想 phone 数字字段。如果您根本不知道某人是否有电话 phone 号码,则该字段应为 Null。如果您知道某人没有电话phone,那么该字段应该是空。
不管文档怎么说,IsEmpty
检查值 varEmpty
和 IsNull
检查值 varNull
.