No procedure/sub statement?
BlitzMax Forums/BlitzMax Beginners Area/No procedure/sub statement?
| ||
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)? |
| ||
Functions don't have to return a value. |
| ||
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. |
| ||
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. |
| ||
This is partly what I've disliked about other Basic languages that have seperate keywords for making functions. |
| ||
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 |