View previous topic :: View next topic |
Author |
Message |
mhumph
Joined: 11 Feb 2007 Posts: 6
|
Posted: Mon Mar 05, 2007 2:16 am Post subject: Use of the ENUM keyword |
|
|
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 _________________ Mike H. |
|
Back to top |
|
|
Ade
Joined: 20 Jul 2010 Posts: 6
|
Posted: Thu Sep 16, 2010 4:13 pm Post subject: |
|
|
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? _________________ Adrian Paveling
Systems Developer
McCarthy Taylor Systems Ltd
www.dtmsoftware.com |
|
Back to top |
|
|
silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Mon Oct 04, 2010 2:36 pm Post subject: |
|
|
We are looking into this. |
|
Back to top |
|
|
silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Wed Oct 06, 2010 8:59 am Post subject: |
|
|
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. |
|
Back to top |
|
|
lozzer
Joined: 27 Jun 2007 Posts: 49
|
Posted: Fri Oct 08, 2010 3:14 pm Post subject: Re: |
|
|
silverfrost wrote: | 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? _________________ Lozzer |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Sat Oct 09, 2010 8:01 am Post subject: |
|
|
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. |
|
Back to top |
|
|
Sebastian
Joined: 20 Feb 2008 Posts: 177
|
Posted: Sat Oct 09, 2010 12:13 pm Post subject: |
|
|
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 { left = 1, right = 2}" 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. |
|
Back to top |
|
|
Ade
Joined: 20 Jul 2010 Posts: 6
|
Posted: Tue Oct 26, 2010 9:47 am Post subject: Re: |
|
|
PaulLaidler wrote: | 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! _________________ Adrian Paveling
Systems Developer
McCarthy Taylor Systems Ltd
www.dtmsoftware.com |
|
Back to top |
|
|
|