20,741
edits
Line 143: | Line 143: | ||
Rebuild & run FlightGear, and then fire up the [[Nasal Console]], and run this: | Rebuild & run FlightGear, and then fire up the [[Nasal Console]], and run this: | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
# inspect our new test namespace | |||
debug.dump( test ); | |||
# create a test object: | |||
var obj = test.new(); | |||
# inspect the result of running our allocator function | # inspect the result of running our allocator function | ||
debug.dump( | debug.dump( obj ); | ||
# run the hello method | # run the hello method | ||
obj.hello(); | |||
# print the value | |||
print( obj.value ); | |||
# change the value | |||
obj.value = 4444; | |||
# print it again | |||
print( obj.value ); | |||
</syntaxhighlight> | </syntaxhighlight> | ||