Function overloading

BlitzMax Forums/BlitzMax Programming/Function overloading

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.

Do you not understand how get/set was intended to be used? or are you just being sarcastic?

The purpose of the get/set bits of a field is used for playing around with the value thats coming in or doing something else along with setting or getting the value.

example:
Type myType

	Field otherfield:Float
		
		Method dostuff(fab:String, par:String)
			Print fab + " is being " + par
			'... do some other stuff
		End Method
		
		Method name:String(value:String = Null)
		  Global getval:String
			
			'set
			If value
				otherfield = 0.0002
				dostuff("name", "set!")
				getval = value + otherfield
			   Return Null
			EndIf
			
			'get
			dostuff("name", "requested!")
			otherfield = RndFloat()
		   Return getval
		End Method
		
End Type

Local mt:myType = New myType
	mt.name "test"
	Print mt.name()