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 15:02, 9 December 2009
, 14 years ago→{{header|Falcon}}
Line 129:
vect += 'delta'
vect.dump()</lang>
Output from the above:
<lang falcon>0: alpha
1: beta
2: gamma
3: delta</lang>
'''Dictionary:'''
In this example we will add a variable through the use of an object from a bless'ed dictionary. We create a new variable called 'newVar' at runtime and assign a string to it. Additionally we assign an external, to the object, function (sub_func) to the variable 'sub'.
|