method and function

BlitzMax Forums/BlitzMax Beginners Area/method and function

Just change the line
a.do_function(a)

in Shambler's second bit of code to
mytype.do_function(a)

That's it. Think of functions as a property of the type itself, rather than specific objects of the type.

Do you understand the use of Globals in types? It's a very similar idea.