Enumerations: Difference between revisions

m
(Added PicoLisp)
Line 464:
 
=={{header|PureBasic}}==
Basic Enumeration is defined as
<lang PureBasic>Enumeration
#Apple
#Banana
#Cherry
EndEnumeration</lang>
This can also be adjusted to the form
<lang PureBasic>Enumeration 10200 Step 12
#Constant1 ; 10200
#Constant2 ; 10212
#Constant3 ; 10224
#Constant4 = 10117 ; 10117
#Constant5 ; 10229
EndEnumeration</lang>
The system constant "#PB_Compiler_EnumerationValue" holds last defined value and can be used to chain to a previously stared serie.
 
E.g. in combination with the code above;
<lang PureBasic>Enumeration #PB_Compiler_EnumerationValue
#Constant_A ; 10241
#Constant_B ; 10242
EndEnumeration</lang>
 
Anonymous user