Enumerations: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
Line 2,179:
The only way to give such a variable a value without setting it explicitly is to add one to the previous such variable which (in effect) is what a C-style enum does. If you declare a variable in Wren without giving it a value, then it is set to the special value ''null'' which is no help here.
<syntaxhighlight lang="
var ORANGE = 2
var PEAR = 3
Line 2,197:
<br>
{{libheader|Wren-dynamic}}
<syntaxhighlight lang="
var Fruit = Enum.create("Fruit", ["apple", "orange", "pear", "cherry", "banana", "grape"], 1)
|