replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Usage of ENUM Type
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 

Usage of ENUM Type

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



Joined: 18 Dec 2009
Posts: 34
Location: Stuttgart, Germany

PostPosted: Sun Mar 04, 2012 11:27 am    Post subject: Usage of ENUM Type Reply with quote

Hello,

according to the revision history, in rev. 6.20 the ENUM Type has been implemented, however there is no any documentation how to use/define it - or at least I cannot find in the help.

I would like the use the ENUM type as an argument in calling a .NET method in FTN95 (the method is defined in C#). Is there a way to do this with the new feature?

Best regards,
Goran
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Sun Mar 04, 2012 11:49 am    Post subject: Re: Usage of ENUM Type Reply with quote

Open ftn95.chm and look up ENUM. Note that this feature is different from the enumerators of Fortran 2003.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Mar 04, 2012 4:38 pm    Post subject: Reply with quote

I will have to check the details but ENUM was incorrectly documented in the help file. I have recently added, what should be a standard conforming implementation of ENUM. I will aim to check this tomorrow and get back to you. As far a .NET is concerned, an FTN95 ENUM will just appear as an INTEGER of default KIND.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 05, 2012 11:21 am    Post subject: Reply with quote

The topic in the help file on ".NET enumerated types" should be ignored. I will remove it for the next release.

The following code works OK for .NET but not for Win32. I will log this as a bug that needs fixing.

Code:
ENUM,bind(C)
 ENUMERATOR::RED = 4, BLUE = 9
 ENUMERATOR YELLOW
END ENUM
if(RED==4.AND.BLUE==9.AND.YELLOW==10) print*,"Success"
END
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 05, 2012 11:40 am    Post subject: Reply with quote

Correction: The code above does work when you use /f2k on the command line. So I will have to investigate why this option is not needed for .NET.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 05, 2012 11:52 am    Post subject: Reply with quote

/clr implies /f2k as it says in the help file. So everything is OK apart from the erroneous topic on ".NET enumerated types" which I will remove.
Back to top
View user's profile Send private message AIM Address
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