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

Richard Ward roward at mac.com
Thu Nov 5 14:27:53 CET 2009


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.

Also, I have been trying to purge my code of anything to do with  
Mmacpas mode so it can be compatible with the new Objective C  
extensions being worked on in preparation for "PasCocoa/iPhone  
development" (or whatever it may end up being named.)  The only  
keyword I am having trouble getting rid of is "return".   There was  
some discussion of this previously as being able to replace "return"  
with "exit" but those two keywords are not quite a simple one word  
replacement in implementation.   Again, it is not something I can't do  
without but it seems a nice clean way of doing things.

Although there may be a few people who need a backwards mac  
compatibility mode porting things from THINK Pascal, it might be  
considered to drop it since it seems to conflict with other compiler  
modes.



More information about the fpc-pascal mailing list