Skip to content

Instantly share code, notes, and snippets.

@JTheiller
Last active April 29, 2021 20:24
Show Gist options
  • Save JTheiller/1c61ad0e4519ca7022303a40b3fa5e3d to your computer and use it in GitHub Desktop.
Save JTheiller/1c61ad0e4519ca7022303a40b3fa5e3d to your computer and use it in GitHub Desktop.
check if its value is not defined
function VarIsEmptyOrNull(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 = EmptyStr;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment