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

Content added Content deleted
m (added omits)
m (Fixed XBS example)
Line 1: Line 1:
{{task|Object oriented}}
<nowiki>Insert non-formatted text here</nowiki>{{task|Object oriented}}


Demonstrate how to dynamically add variables to an object (a class instance) at runtime.
Demonstrate how to dynamically add variables to an object (a class instance) at runtime.
Line 1,926: Line 1,926:
=={{header|XBS}}==
=={{header|XBS}}==
<lang xbs>set Object = {}
<lang xbs>set Object = {}
Object:Hello = "World";
Object.Hello = "World";
log(Object.Hello);</lang>
log(Object.Hello);</lang>
{{out}}
{{out}}