[fpc-pascal] How can I implement "thrice" in Free Pascal?

Sven Barth pascaldragon at googlemail.com
Wed Oct 19 08:28:40 CEST 2011


Am 18.10.2011 23:08, schrieb Andrew Pennebaker:
> Barth, something's not quite right. I've compiled and installed the
> trunk version of fpc, but it won't recognize this syntax.
>
> paycheck.pas:
>
> unit Paycheck;
> interface
> type
> TArray<T> = array of T;
> ...
>
> Trace:
>
> fpc example.pas
> Compiling example.pas
> Compiling paycheck.pas
> paycheck.pas(4,8) Fatal: Syntax error, "=" expected but "<" found
> Fatal: Compilation aborted
>
> Either my syntax is wrong, or trunk doesn't have the syntax, or I'm
> having trouble getting the trunk version.

You either need to add "{$mode delphi}" between "unit Paycheck;" and 
"interface" or you need to write it like this (though I haven't tested it):

type
   generic TArray<T> = array of T;

Regards,
Sven

PS: It's more polite to use the first name when addressing persons in a 
mailing list.




More information about the fpc-pascal mailing list