issue 0029313 regressin
Original Reporter info from Mantis: nicolagorlandi
-
Reporter name: nicola gorlandi
Original Reporter info from Mantis: nicolagorlandi
- Reporter name: nicola gorlandi
Description:
In case of formatfloat function is used in script and the extended parameter is equals to 0 lzreport went in error because null value is returned after the 0029313.
I suppose that even the other function that aspect a not null variant may have the same issue (e.g. formatdate).
Steps to reproduce:
Create a script as where field PREZZO is equals to 0
text:=[FORMATFLOAT('######', ["PREZZO"])];
Additional information:
In order to solve it I change in lr_class in TfrStdFunctionLibrary.DoFunction as below:
Added in var declaration
varValue:variant;
extendedvalue:extended;
valueVarType:TVarType;
Changing the 4 case in
4:
begin
varValue :=frParser.Calc(p2);
extendedvalue:=0;
if not varIsNull(varValue) then
begin
valueVarType := varType(varValue);
if (valueVarType=varSmallint)or
(valueVarType=varInteger) or
(valueVarType=varSingle) or
(valueVarType=varDouble) or
(valueVarType=varCurrency)
then extendedvalue:=varValue;
end;
val := FormatFloat(frParser.Calc(p1), extendedvalue ); //Add('FORMATFLOAT'); {4}
end;
Mantis conversion info:
- Mantis ID: 34213
- Version: 2.3 (SVN)
- Fixed in version: 1.9 (SVN)
- Fixed in revision: 58906 (#a4bad60e)
- Target version: 1.10