What is the difference between passing values by reference and sharing variables with SHARE?
You can pass arguments in functions by value or by reference. Arguments that are passed by reference must use the @ prefix. All strings and arrays MUST be passed by reference. MyFunction (v0, @v1, @string$, @array[]) v0 is passed by value v1, string$, and array are passed by reference If v1, string$, or array[] are modified within MyFunction ( ), then on the return of the function, these arguments will hold their new values and be available to the calling program. Shared variables are globally available to all functions within your program. However, you must declare the shared variables within each function that uses them.
Related Questions
- As Fixnum, true, nil, and false are implemented as immediate values, what is the difference between an immediate value and a reference?
- Explain the difference between passing parameters by value and passing parameters by reference with an example?
- Whats the difference between the File Sharing pod and the Share pod?