Pointers-POINT me in the right direction :).

BlitzMax Forums/BlitzMax Beginners Area/Pointers-POINT me in the right direction :).

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.

Hi Ryan. Here's a simple example. The function ChangeFruitSize() amends the size field in an instance of TFruit :-

SuperStrict

Type TFruit
	Field size:Float
EndType

Function ChangeFruitSize( f:TFruit, newSize:Float )
	f.size = newSize
EndFunction

Global fruit:TFruit = New TFruit
fruit.size = 5.0 ' Initial size is 5

Print "Size before calling function : " + fruit.size
ChangeFruitSize( fruit, 10.0 ) ' Change the size to 10
Print "Size after calling function  : " + fruit.size