diff --git a/scriptLib.pas b/scriptLib.pas index 2adc95d..1be38c0 100644 --- a/scriptLib.pas +++ b/scriptLib.pas @@ -1962,10 +1962,7 @@ function cbMacros(fullMacro:string; pars:Tstrings; cbData:pointer):string; begin try if isFalse(parEx('if')) then - begin - result:=''; - exit; - end; + exit(''); except end; result:=md.cd.disconnectReason; // return the previous state if pars.count > 0 then md.cd.disconnectReason:=p; diff --git a/utillib.pas b/utillib.pas index 936b36e..dda375b 100644 --- a/utillib.pas +++ b/utillib.pas @@ -2576,7 +2576,8 @@ function evalFormula(s:string):real; i:=mImp+dir; repeat j:=i+dir; - if (j > 0) and (j <= length(s)) and charInSet(s[j], ['0'..'9','.']) then + if (j > 0) and (j <= length(s)) + and (charInSet(s[j], ['0'..'9','.','E']) or (j>1) and charInSet(s[j],['+','-']) and (s[j-1]='E')) then i:=j else break; @@ -2606,6 +2607,7 @@ function evalFormula(s:string):real; end; if (i = 1) // a starting operator is not an operator + or (s[i-1]='E') // exponential syntax or (v <= mImpV) // left-to-right precedence then continue; // we got a better one, record it