Missing featues : array over enum

This is the first article in the blog comparing Delphi features to C#.
C# is a great language but is missing some incedibly useful features from Delphi.

In Delphi you can declare an enumeration as

TEnumColour = (Red, Green, Blue);

You can then declare an array over that enumeration:

TWaveLength : array[TEnumColour] of integer  = (100,200,300);

This is a very powerful technique for ensuring that an enumeration always has valid data.

I have yet to work out how to do this in C#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s