Jump to content

Add a variable to a class instance at runtime: Difference between revisions

m
Lingo 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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.