16,748
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.btn1Click(Sender: TObject);
var
a:Variant;
begin
if VarIsNull(a) then
ShowMessage('VarIsNull=true');
if VarIsEmpty(a) then
ShowMessage('VarIsEmpty=true'); //执行
a:=vaNull;
if VarIsNull(a) then
ShowMessage('a:=vaNull,VarIsNull=true');
if VarIsEmpty(a) then
ShowMessage('a:=vaNull,VarIsEmpty=true');
a:=Unassigned;
if VarIsNull(a) then
ShowMessage('a:=Unassigned,VarIsNull=true');
if VarIsEmpty(a) then
ShowMessage('a:=Unassigned,VarIsEmpty=true'); //执行
a:=null;
if VarIsNull(a) then
ShowMessage('a:=null,VarIsNull=true'); //执行
if VarIsEmpty(a) then
ShowMessage('a:=null,VarIsEmpty=true');
end;