Sign in Join

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

Mailing lists / fpc-pascal / 2014-03

Enumeration type: FreePascal Vs. Delphi

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Unknown author

Hello everybody,

A project of mine was forked and adapted to Delphi by a programmer. Now we're working to join both branches.

He did change the enumerations, he did use "=" instead of ":=" in assignments.
 I've read FPC's documentation (Reference guide - 3.1.1 Ordinal types -
Enumeration types) and it says that the correct way is to use ":=", but I did
test using "=" and FPC didn't failed.

To illustrate it:

The FPC way:

(...)
ALLEGRO_PRIM_ATTR = (

      ALLEGRO_PRIM_ATTR_NONE := 0,
      ALLEGRO_PRIM_POSITION := 1,
      (...)
    );

(...)

The Delphi way:

(...)
ALLEGRO_PRIM_ATTR = (
ALLEGRO_PRIM_ATTR_NONE = 0,
ALLEGRO_PRIM_POSITION = 1,
(...)

    );

(...)

I'm not sure if Delphi fails when using ":=" (he also remove all "INLINE"
modifiers, but I'm pretty sure that Delphi can deal with them correctly) but
I'm wondering, is "=" correct in FPC or should I use ":="?

Thanks,
Guillermo "Ñuño" Martínez