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 are LOCAL variables and why do I care?

local variables
0
Posted

What are LOCAL variables and why do I care?

0

LOCAL variables are somewhat like PRIVATE variables in that they do not “scope up”; if you declare a PRIVATE or LOCAL variable in function B which is called from function A, then function A does not know the variable exists. Function A is even free to use the same name for a different variable entirely without risk of confusion. This is useful for writing functions that can avoid “stepping on” the variables that are floating around a larger application. LOCAL variables, introduced with Clipper 5.0, enforce a stricter kind of modularity. A LOCAL variable must be declared, and it is visible only to the particular function in which it is declared. (Remember that PRIVATEs are created by default.) Not only does a LOCAL variable refrain from “up-scoping” but it also will not “down-scope” either.

Related Questions

What is your question?

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

Experts123