On 29 Jul 2010, at 20:31, José Mejuto wrote:

> 1) Is there any way in Pascal to write something like this
> (pseudocode):
> 
> With Result:=Object.Create() do begin
>  Free;
> end;

Just leave out the "Result:=" part and it will compile/work fine..

> 2) Which is the expected way to detect if a float value is exact ?
> Maybe only applying "if V = trunc(V) then ..." ?

Use "if V = int(V) then ..." instead. trunc() converts to an int64 (which will 
then again be converted to a float), while int() returns a floating point type 
(with the fractional part removed).


Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to