I don't think Var was a good idea.

BlitzMax Forums/BlitzMax Programming/I don't think Var was a good idea.

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.

I agree with sswift that OO can be allot more difficult to read and navigate and i am moving more and more toward simple code these days.

I like objects as a way of grouping logical blocks of code. I like the idea of an objects methods operating on itself. I steer away from unnecessary inheritance as i find it obfuscates things.

Oh and regarding the original topic.. i'm not sure if i understand what the issue is but Var is not needed to "return multiple values". All objects are passed by reference by default, if you wrap x and y in a type and pass them in you don't need the var keyword. Would be the same for you x1,y1,x2,y2 example.

I read your post a few times but i don't really understand what it is you are saying you don't like. I'm new to programming stuff.


Type tSize
	Field x:Int
	Field y:Int
End Type

Function ModifyObject (size:tsize)
	size.x = 10
	size.y = 20
End Function

Local big:tSize = New tSize

big.x = 100
big.y = 100

Print big.x+":"+big.y 

ModifyObject (big)

Print big.x+":"+big.y