Add a variable to a class instance at runtime: Difference between revisions
Content added Content deleted
m (Lingo added) |
|||
Line 684: | Line 684: | ||
# or equivalently: |
# or equivalently: |
||
$a|.["c"] = 3</lang> |
$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}}== |
=={{header|LOLCODE}}== |