如題,謝謝!!

解决方案 »

  1.   

    Var
      a: Variant;  a:=Unassigned;  
      if VarIsEmpty(a) then   a:=null;
      if VarIsNull(a) then
      

  2.   

    function VarIsNull(const V: Variant): Boolean;DescriptionVarIsNull returns True if the given variant contains the value Null. If the variant contains any other value, the function result is False.Note: Do not confuse a Null variant with an unassigned variant. A Null variant is still assigned, but has the value Null. Unlike unassigned variants, Null variants can be used in expressions and can be converted to other types of variants.
      

  3.   

    function VarIsEmpty(const V: Variant): Boolean;DescriptionVarIsEmpty returns True if the given variant contains the value Unassigned. If the variant contains any other value, the function result is False.Note: VarIsEmpty does not indicate when a Variant that represents an interface has had the interface pointer cleared or when a custom Variant is clear. If either of these situations may exist, use the VarIsClear method instead.
    Note: Do not confuse an unassigned variant with a Null variant. A Null variant is still assigned, but has the value Null. Unlike unassigned variants, Null variants can be used in expressions and can be converted to other types of variants.
      

  4.   

    在Variant变量里,empty与null是不同的值...........  varEmpty    = $0000; { vt_empty        0 }
      varNull     = $0001; { vt_null         1 }