I need to have a routine modify my input parameters, but Blitz doesn't seem to support 'ByRef'. I am sure other people have had to do something similar (particularly for collision and math functions).
Here is an example:
Function Normalize2D( x1#, y1# )
Local vLen# = Sqr( ( x1# * x1# ) + ( y1# * y1# ) )
If vLen# < 0.00001 Then
x1# = 0.0
y1# = 0.0
Else
x1# = x1# / vLen#
y1# = y1# / vLen#
EndIf
End Function
The modified values for x1, y1 need to be returned to the caller of the function.
The only thing that appears to come close to this is using a bank which seems like a lot of code overhead for such a simple thing.
Thanks,
- Ken
Here is an example:
Function Normalize2D( x1#, y1# )
Local vLen# = Sqr( ( x1# * x1# ) + ( y1# * y1# ) )
If vLen# < 0.00001 Then
x1# = 0.0
y1# = 0.0
Else
x1# = x1# / vLen#
y1# = y1# / vLen#
EndIf
End Function
The modified values for x1, y1 need to be returned to the caller of the function.
The only thing that appears to come close to this is using a bank which seems like a lot of code overhead for such a simple thing.
Thanks,
- Ken