uses
System.SysUtils, System.Variants,
System.Win.ComObj;
var
D: Variant;
S: string;
begin
//a plain value has no members:
//the RTL converts it first
D := 'some string';
S := VarToStr(D);
WriteLn(S.ToUpper);
//SOME STRING
//an OLE object resolves members
//at run time
D := CreateOleObject(
'Scripting.Dictionary');
D.Add('pi', 3.14);
D.Add('e', 2.71);
WriteLn('count is ', VarToStr(D.Count));
//count is 2
WriteLn('pi is ', VarToStr(D.Item['pi']));
//pi is 3.14
//a misspelled name compiles and
//fails only at run time
//WriteLn(D.Cnt); <- run time error
end.