-
-
Save wellington1993/c7daaadd011990df27c5265819eb90cc to your computer and use it in GitHub Desktop.
Check if Variant is empty or null in Delphi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uses System, Variants | |
function IsEmptyOrNull(const Value: Variant): Boolean; | |
begin | |
Result := VarIsClear(Value) or VarIsEmpty(Value) or VarIsNull(Value) or (VarCompareValue(Value, Unassigned) = vrEqual); | |
if (not Result) and VarIsStr(Value) then | |
Result := Value = ''; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment