Skip to content

Instantly share code, notes, and snippets.

View adnanoncevarlik's full-sized avatar

Adnan ÖNCEVARLIK adnanoncevarlik

View GitHub Profile
@martinusso
martinusso / IsEmptyOrNull.pas
Created January 10, 2017 15:44
Check if Variant is empty or null in Delphi
// 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;