Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-09

C-->Pas translation question

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Henry Vermaak
to yu ping

2009/9/8 yu ping :

how to translate following C code to pascal? enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE};
type
  TMyEnum = (IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE);

Henry

Reply by email

James Buren
to yu ping: how to translate following C code to pascal? enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE,…
Show quoted text 9 lines
how to translate following C code to pascal? enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE}; thanks _______________________________________________ fpc-pascal maillist - 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.

Reply by email