[fpc-pascal] Re: Enums RTTI/WriteStr & Mmacpas

Michael Van Canneyt michael at freepascal.org
Thu Nov 5 14:38:47 CET 2009



On Thu, 5 Nov 2009, Richard Ward wrote:

>
> On Nov 5, 2009, Jonas wrote:
>
>> As of FPC 2.4.0, you will be able to use
>> 
>> var
>> s: string; { any kind of string will work
>> begin
>> writestr(s,enumvar);
>> end;
>> 
>> And afterwards 's' will contain the string representation of enumvar. In 
>> general, writestr is identical to the regular "write" procedure, except 
>> that it stores its output in a string (which you have to pass as first 
>> parameter). A similar "readstr" procedure will also be available.
>
> Will readstr and writestr procedures be able to take multiple parameters for 
> the variables or just one?   For older mac programmers, these functions were 
> used a lot and are nice to have.   I know we have val and str in FPC but I 
> keep forgetting the syntax and order of arguments of the FPC procedures. 
> Not a big deal but I've always liked the readstr and writestr procedures.

It works just like regular read/write, but the output/input is going
to/taken from a string.

Michael.



More information about the fpc-pascal mailing list