"Richard Ward" <row...@mac.com> wrote in message 
news:6707d87e-2ea6-4469-97a5-cf55d1a04...@mac.com...
As a user of the old Macintosh Pascal (later THINK Pascal),  both ReadStr 
and WriteStr functions were included and I used them quite a bit.   The 
names were different but the FPC implementation is basically the same as far 
as I can tell.

Besides backward compatibility, portability issues and personal preference, 
is there any functionality Val and Str may have that ReadStr and WriteStr 
don't?  I can't see any, but wanted to make sure there there were no subtle 
technical issue(s) I might need to consider.

Thank you for implementing these functions. 
_______________________________________________
fpc-pascal maillist  - 
fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Hi Richard,
 I don't know about the Macintosh Pascal ReadStr and WriteStr routines 
(never used them), but a 'possible' gotcha is that I think the Str() 
function will append a space at the beginning of a value to leave room for 
the sign if negative...

if you don't want that then you can use the Format routine instead:

Integer to string:
s := Format('%d',[<some integer number>]);

float to string:
s := Format('%.4f',[<some floating point number>]); //formats a floating 
point number to 4 decimal places (just change, or remove if you want 
scientific notation I think)

I hope this helps :)

cheers,
Paul 



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

Reply via email to