Anonymous user
Add a variable to a class instance at runtime: Difference between revisions
Add a variable to a class instance at runtime (view source)
Revision as of 08:48, 31 March 2018
, 6 years agoLingo added
m (Lingo added) |
|||
Line 684:
# or equivalently:
$a|.["c"] = 3</lang>
=={{header|Lingo}}==
<lang Lingo>obj = script("MyClass").new()
put obj.foo
-- "FOO"
-- add new property 'bar'
obj.setProp(#bar, "BAR")
put obj.bar
-- "BAR"</lang>
=={{header|LOLCODE}}==
|