Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Language Reference > VarIsEmpty Function

Name

VarIsEmpty Function

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

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint