method and function

BlitzMax Forums/BlitzMax Beginners Area/method and function

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Right. Also, you can call the function from the type itself - mytype.do_function() - instead of calling it from an instance.
Which is how you should do it in the first place.

In what situation a function would be more handy then a method inside the type?
In situations where you don't have, or don't need a specific object/instance. For example when dealing with creation problems (as mentioned above) and access to "Global fields" (also know as static variables, class variables or type variables) in the type.

Ofcourse in Blitz, there are no access modifiers and thus everything has global, or near-global visibility, thus somewhat limiting its usefulness.