auto type casting : it does not work when wordbool to Boolean in index of array
Original Reporter info from Mantis: taka_jp
-
Reporter name: removed
Original Reporter info from Mantis: taka_jp
- Reporter name: removed
Description:
------------------------------------------------------------------
program test;
uses sysutils;
var
a : array [Boolean,Boolean] of string;
b : wordbool;
begin
a[False,True] := 'True';
a[False,False] := 'False';
a[True,True] := 'True';
a[True,False] := 'False';
b := True;
writeln('a[False,b]= [' + a[False,b] +']');
writeln('a[False,Boolean(b)]= [' + a[False,Boolean(b)] +']');
end.
------------------------------------------------------------------
[run result]
(fpc) Free Pascal Compiler version 2.5.1 [2009/12/17] for i386
a[False,b]= [] <-----------
a[False,Boolean(b)]= [True]
(Delphi)
a[False,b]= [True]
a[False,Boolean(b)]= [True]
------------------------------------------------------------------
this bug influence to function TBooleanField.GetAsString: string;
[fcl-db] TBooleanField.AsString return incorrect value(such as True;False) when True;
fpcsrc/packages/fcl-db/src/base/fields.inc
function TBooleanField.GetAsString: string;
Var B : wordbool;
begin
If Getdata(@B) then
- Result:=FDisplays[False,B]
+ Result:=FDisplays[False,Boolean(B)]
Mantis conversion info:
- Mantis ID: 15364
- OS: windows
- OS Build: xp
- Version: 2.5.1
- Fixed in version: 2.4.2
- Fixed in revision: 15175 (#75b5b6c7)