[Lazarus] VoIP / SIP communication initiated from LCL apps

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Dec 8 15:18:46 CET 2009


On Tue, Dec 8, 2009 at 03:49, David Emerson <dle3ab at angelbase.com> wrote:
> Of course, if you have a set of all the valid characters
> ['-', '.', '0'..'9', 'e', 'E', '+'], it's not unreasonable to restrict
> characters outside that set. But make sure the set is complete-- at
> first I overlooked "e+" which is valid for val (string, real)
>

No, it is not:

t.pas
---
var
  x: Double;
  d: Integer;
begin
  Val('e+', x, d);
  Writeln(x, ' ', d);
end.
---
dcc32 -cc t.pas
t.exe
==>
 0.00000000000000E+0000 3
---
fpc t.pas
t.exe
==>
 0.00000000000000E+000 1

So both Delphi and FPC reject 'e+' as a floating-point value,
although with different error positions.
The latter is probably a compatibility bug in FPC's Val procedure.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list