Enumerations: Difference between revisions

Content deleted Content added
PureFox (talk | contribs)
Added code for FreeBASIC
Line 492:
 
does not work with gfortran; it is used in some [http://docs.cray.com/books/S-3692-51/html-S-3692-51/z970507905n9123.html Cray docs] about Fortran, but the syntax shown at [http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlf101a.doc/xlflr/enum.htm IBM] is the one gfortran can understand. (Cray's docs refer to Fortran 2003 draft, IBM docs refers to Fortran 2003 standard, but read the brief [http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/topic/com.ibm.xlf101a.doc/xlflr/languagestandards.htm#wq17 Fortran 2003 Standard] section to understand why differences may exist...)
 
=={{header|FreeBASIC}}==
<lang freebasic>' FB 1.05.0 Win64
 
Enum Animals
Cat
Dog
Zebra
End Enum
 
Enum Dogs
Bulldog = 1
Terrier = 2
WolfHound = 4
End Enum
 
Print Cat, Dog, Zebra
Print Bulldog, Terrier, WolfHound
Sleep</lang>
 
{{out}}
<pre>
0 1 2
1 2 4
</pre>
 
=={{header|F_Sharp|F#}}==