forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of the ENUM keyword

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mhumph



Joined: 11 Feb 2007
Posts: 6

PostPosted: Mon Mar 05, 2007 2:16 am    Post subject: Use of the ENUM keyword Reply with quote

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
View user's profile Send private message
Ade



Joined: 20 Jul 2010
Posts: 6

PostPosted: Thu Sep 16, 2010 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 191
Location: Manchester

PostPosted: Mon Oct 04, 2010 2:36 pm    Post subject: Reply with quote

We are looking into this.
Back to top
View user's profile Send private message Visit poster's website
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 191
Location: Manchester

PostPosted: Wed Oct 06, 2010 8:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
lozzer



Joined: 27 Jun 2007
Posts: 49

PostPosted: Fri Oct 08, 2010 3:14 pm    Post subject: Re: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Oct 09, 2010 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Sat Oct 09, 2010 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ade



Joined: 20 Jul 2010
Posts: 6

PostPosted: Tue Oct 26, 2010 9:47 am    Post subject: Re: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group