Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between passing values by reference and sharing variables with SHARE?

0
Posted

What is the difference between passing values by reference and sharing variables with SHARE?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123