uses System.Variants;
var
N1, N2, CharA: Variant;
IntValue1, IntValue2: Integer;
CharValue: string;
begin
N1 := 42;
IntValue1 := N1;
//intValue1 is 42
//assigning Null raises EVariantError,
//check first
N2 := Null;
if VarIsNull(N2) then
IntValue2 := 7
else
IntValue2 := N2;
//intValue2 is 7
CharA := 'A';
CharValue := VarToStr(CharA);
//charValue is 'A'
WriteLn('intValue1 is ', IntValue1);
WriteLn('intValue2 is ', IntValue2);
WriteLn('charValue is ', CharValue);
end.