Feature Request - ByRef

Blitz3D Forums/Blitz3D Programming/Feature Request - ByRef

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Yep, pretty much as Dev said (except I believe that instead of a 'copy' being passed then edited, the memory address where the variable is held is passed).
Any changes made to the variable within the function are therefore actually made in the original. This has many benefits: two that immediately spring to mind are that you no longer have to use global variables, thus improving coding style by introducing variable 'scope', and if you pass a variable by reference (even if you don't intend to actually change it), then the memory and speed overhead of making a copy (which can be relatively large if the variable is a large instance of a type) is saved.

Basically, it is a feature which most modern languages implement - certainly Visual Basic, C++ and Java.