mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 15:56:10 +02:00
LazReport: The <expression> in the IF function can be a boolean value plus checks for NULL and EMPTY.
git-svn-id: trunk@57597 -
This commit is contained in:
parent
755a6e60ef
commit
e6c02d77d7
@ -134,6 +134,8 @@ var
|
||||
s1, s2, s3, s4: String;
|
||||
nm: Array[1..32] of Variant;
|
||||
v: Double;
|
||||
vCalc: Variant;
|
||||
vBool: boolean;
|
||||
begin
|
||||
{$IFDEF DebugLRCalcs}
|
||||
DebugLnEnter('TfrParser.CalcOPZ INIT s=%s',[dbgstr(s)]);
|
||||
@ -275,7 +277,15 @@ begin
|
||||
end
|
||||
else if s1 = 'IF' then
|
||||
begin
|
||||
if Int(StrToFloat(Calc(s2))) <> 0 then
|
||||
vCalc := Calc(S2);
|
||||
if VarIsEmpty(vCalc) or varIsNull(vCalc) then
|
||||
vBool := false
|
||||
else
|
||||
if VarIsBool(vCalc) then
|
||||
vBool := vCalc
|
||||
else
|
||||
vBool := Int(StrToFloat(vCalc)) <> 0;
|
||||
if vBool then
|
||||
s1 := s3 else
|
||||
s1 := s4;
|
||||
{$IFDEF DebugLRCalcs}
|
||||
|
Loading…
Reference in New Issue
Block a user