[fpc-pascal] ReadStr/WriteStr vs Val/Str

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Oct 19 10:25:26 CEST 2010


On 19 Oct 2010, at 01:56, Richard Ward wrote:

> 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.

readstr gives a run time error when you try to read an invalid number, while val() returns an error in the last parameter. Other than that, they all use the same helper routines to perform the actual conversions.


Jonas


More information about the fpc-pascal mailing list