Syntax
function VarIsEmpty(const V: Variant): Boolean;
Description
VarIsEmpty
returns True if the
Variant
V
has the
varEmpty
type, and it returns False for any other
kind of Variant
. A
Variant
’s initial type is
varEmpty
.
VarIsEmpty
is a real function.
Example
// Convert a Variant to a TDateTime, but if the Variant
// does not have a value, return the current date and time.
function GetDate(V: Variant): TDateTime;
begin
if VarIsEmpty(V) or VarIsNull(V) then
Result := Now
else
Result := VarToDateTime(V);
end;
See Also
Unassigned Variable, VarClear Procedure, Variant Type, VarIsNull Function, VarType Function |