Silverfrost Forums

Welcome to our forums

Use of the ENUM keyword

5 Mar 2007 1:16 #1774

I want to use the ENUM keyword in manner described under '.NET enumerated types' in FTN95 help, but when I use syntax shown there (see below), I get a syntax error on the ENUM statement. I cannot find any other reference to the ENUM keyword in any other section of the help. The example below, given in help, also generates a syntax error when compiled. Any help would be appreciated.

CHARACTER(LEN=60),PARAMETER::CONVENTION='System.Runtime.InteropServices.CallingConvention' ENUM(CONVENTION)::MY_CONVENTION

16 Sep 2010 3:13 #6950

Also getting syntax error with this code despite copying it exactly from the help. I was trying with my own enums to start with but since that was failing, I tried the example.

Any comments?

4 Oct 2010 1:36 #7033

We are looking into this.


-- Admin Silverfrost Limited
6 Oct 2010 7:59 #7042

This syntax doesn't work. The compiler has some code to handle the syntax but none of it is hooked up and has never worked.


-- Admin Silverfrost Limited
8 Oct 2010 2:14 #7060

Quoted from silverfrost This syntax doesn't work. The compiler has some code to handle the syntax but none of it is hooked up and has never worked.

Can you please let us know what you are going to do about this?

9 Oct 2010 7:01 #7061

I plan to find out how much work would be required to implement this Fortran 2003 feature. I am hopeful that it will not be too much and that we will be able to make ENUM work in the way that is outlined in the help file. Realistically this work may not be completed before the next release.

Having said this, my own view is that ENUM is not a particularly significant feature. Even when coding in C++ I do not necessarily use enum when it would be natural to do so.

9 Oct 2010 11:13 #7062

They make much better readable code and are nice to work with, for example using the IntelliSense things in c#.

I don't know if this is helpful in this case, but for interfacing (with fortran, though I'd avoid that) you may use casts in order to pass a basic type instead of an enum. Like define the enum as 'enum direction : int ' and use (int)dir (where dir is of type direction) for passing the value. Doesn't look nice and introduces dependencies between the two code bases, but may be useful in some cases.

26 Oct 2010 8:47 #7087

Quoted from PaulLaidler Having said this, my own view is that ENUM is not a particularly significant feature.

A great deal of the .NET framework uses enums. In order to access this from FTN95 without enum support, I would have to look up the integer value every time I wanted to use it!

Please login to reply.