Declaring variables mid-function changes results

BlitzMax Forums/BlitzMax Programming/Declaring variables mid-function changes results

And don't even think about suggesting the use of Var. I hate that because when you're looking at the function call you can't tell if the value is being passed into the function or being set.

Bear in mind that often times with Var, you're not passing values in *or* setting them, you're actually doing both, but I can see how someone might not find it readable.

Personally I like Var and I use it extensively, but if you don't, you could always declare the parameters as int pointers or float pointers and then you will be able to tell if the value is being passed in or being set because you'll have to use VarPtr() in the function call if you want to set it. I completely agre with your comments about creating an object just to return something. I consider that very bad practice. I try to only ever create a type if it's going to be used for more than one cycle.