fpc/tests/test/packages/fcl-db/tdb6.pp
joost 8d5463bfae * Added test for r12771
git-svn-id: trunk@12772 -
2009-02-22 15:32:27 +00:00

35 lines
613 B
ObjectPascal

program bugVarNullToString;
{$Mode ObjFpc}
{$H+}
uses
Variants, Db, SysUtils;
var
V: Variant;
S: String;
List: TLookupList;
begin
List := TLookupList.Create;
List.Add(1, 'X');
List.Add(2, 'Y');
V := List.ValueOfKey(1);
S := VarToStr(V);
WriteLn(Format('Key: %d Value: "%s"', [1, S]));
if s<>'X' then Halt(1);
V := List.ValueOfKey(2);
S := VarToStr(V);
WriteLn(Format('Key: %d Value: "%s"', [2, S]));
if s<>'Y' then Halt(1);
V := List.ValueOfKey(3);
S := VarToStr(V);
WriteLn(Format('Key: %d Value: "%s"', [3, S]));
if s<>'' then Halt(1);
List.Free;
end.