[fpc-pascal] C-->Pas translation question

James Buren ryuo at frugalware.org
Tue Sep 8 10:38:09 CEST 2009


> how to translate following C code to pascal?
>
> enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE};
>
> thanks
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

Well, according to what you've shown us, its a C enumeration without a
type name, which means it works the same as #defines more or less. The
best way I can think of is to do:

Const
    IUP_SHOW = 0;
...

If I recall, the enumeration starts at 0 in C if its not specified.





More information about the fpc-pascal mailing list