Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call by reference / value
#3
Thing to remember is that passing via reference only works IF variable types match.  For example, change the types from DOUBLE to _FLOAT in the program above.

Best practice, if one doesn't want values to pass by reference, is just to pass to temp variables.

SUB foo(tempX, tempY)
    x = tempX: y = tempY
    'Now use x/y with zero worry over changing your original variable values.
Reply


Messages In This Thread
Call by reference / value - by Kernelpanic - 11-27-2023, 07:54 PM
RE: Call by reference / value - by mnrvovrfc - 11-27-2023, 11:19 PM
RE: Call by reference / value - by SMcNeill - 11-28-2023, 02:36 AM
RE: Call by reference / value - by TerryRitchie - 11-28-2023, 03:41 AM



Users browsing this thread: 2 Guest(s)