No procedure/sub statement?

BlitzMax Forums/BlitzMax Beginners Area/No procedure/sub statement?

kaiserpc(Posted 2008) [#1]
Hi,

just bought Blitzmax and I'm struggling to work out some of the syntax (coming from a vb.net background).

There doesn't appear to be a "procedure" or "sub" statement. I've found the "function" statement, but how do you create blocks of code that don't have return values (I've always assumed that functions must return a value)?


Gabriel(Posted 2008) [#2]
Functions don't have to return a value.


tin(Posted 2008) [#3]
It's depend on.
whether your function / method work as a calculation statement and return results OR it just Alter the visual display.

like in your VB application. all the procedure can return the value or just perform the actions. that's it. same here too.

But BlitzMax is OOP language. we program it in OOP way, not like procedural way.

Mostly, you will be doing Even Driven style programming method. but in BM. you do in OOP way.


Czar Flavius(Posted 2008) [#4]
But BlitzMax is OOP language. we program it in OOP way, not like procedural way.


You can program procedural in BlitzMax too. There's nothing forcing you to use any OOP you don't want to.


Azathoth(Posted 2008) [#5]
This is partly what I've disliked about other Basic languages that have seperate keywords for making functions.


Beaker(Posted 2008) [#6]
Try and always use "SuperStrict" at the top of your code.

Functions don't need a return, but if you want to get the returned value then use brackets, like so:
value = myFunction(a,b,c)
otherwise you can do this:
myFunction a,b,c