Re: Enum?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> Just an an idle thought, it is sometimes useful to know the first and last
> values
> (the range) of an enumeration. Can you think of a syntax that would give us
> this? Maybe something like this, borrowing from RegEx syntax ...
> 
> }}}
<eucode>
> enum
>    FILE_NO,
>    LINE_NO,
>    FILE_PTR,
>    FILE_START_SYM,
>    OP_WARNING,
>    OP_TRACE,
>    OP_TYPE_CHECK,
>    OP_PROFILE_TIME,
>    OP_PROFILE_STATEMENT,
>    OP_DEFINES,
>    minFILE=^, -- first enumeration value
>    maxFILE=$  -- last enumeration value
> </eucode>
{{{

> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

 From what I understand, the first entry in any 'enum' statement is always
set to 1. However, the 'last enumeration value' option would be useful
(for example, to define a sequence of that length for holding a structure),
but I wasn't and still am not sure what would be good syntax for this. I'm not
so sure about the $ syntax proposed.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu