Passing Parameters by Reference?

BlitzPlus Forums/BlitzPlus Programming/Passing Parameters by Reference?

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.

This lack of functionality disappointed me too.

When you say "bank" do you mean an array that you defined earlier with Dim?

Obviously you could use global variables for x# and y# but this may not be desireable. OR you could make a type called Point with 2 fields of x# and y#. You can pass the Point in by calling the function as

Normalize2D(p.Point)

then you can modify the x# and y# as p\x and p\y respectively. This works find for me although I tend to use bigger types such as ManType with 30+ fields. There could be a processing overhead if you are to call the function loads. You could even lamely include the code in the calling function instead of calling your Normalise2D (english ;-)), this is the fastest of all but not very "future proof" or reuseable.