35 lines
833 B
Plaintext
35 lines
833 B
Plaintext
enumeration = script("Enumeration").new("APPLE", "BANANA", "CHERRY")
|
|
|
|
put enumeration["BANANA"]
|
|
-- 2
|
|
|
|
-- try to change a value after construction (fails)
|
|
enumeration["BANANA"] = 666
|
|
put enumeration["BANANA"]
|
|
-- 2
|
|
|
|
-- try to change a value after construction using setProp (fails)
|
|
enumeration.setProp("BANANA", 666)
|
|
put enumeration["BANANA"]
|
|
-- 2
|
|
|
|
-- try to delete a value after construction (fails)
|
|
enumeration.deleteAt(2)
|
|
put enumeration["BANANA"]
|
|
-- 2
|
|
|
|
-- try to delete a value after construction using deleteProp (fails)
|
|
enumeration.deleteProp("BANANA")
|
|
put enumeration["BANANA"]
|
|
-- 2
|
|
|
|
-- try to add a new value after construction (fails)
|
|
enumeration["FOO"] = 666
|
|
put enumeration["FOO"]
|
|
-- <Void>
|
|
|
|
-- try to add a new value after construction using addProp (fails)
|
|
enumeration.addProp("FOO", 666)
|
|
put enumeration["FOO"]
|
|
-- <Void>
|