Declaring Local and Global in a function

BlitzMax Forums/BlitzMax Programming/Declaring Local and Global in a 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.

Nope definitely not.
Functions are clearly declared as beeing NOT instance bound. But a method needs to be executed on an instance -> function has no self so calling a method is called on null which normally should result in "can't be called on null" error.

If you need something thats executed on an instance, use a method. if you want it to be calleable as SomeType.Function then use a function but that one does not know what an instance of type it has to use unless you specify it.

If the compiler would react correctly, doing something like

someTypeInstance.SomeFunction would result in an error that there is no method with that name.