Skip to content
Craig Edwards edited this page Apr 28, 2023 · 3 revisions

LOCAL

LOCAL variable-name = expression

Declare or modify a variable, but mark it as LOCAL, meaning its value is accesible only within the scope of the current PROC, FN or GOSUB context. Once the current procedure, function or subroutine is returned from, any variables marked LOCAL are lost.

NOTE: Any variables which are set via the parameters to a function or procedure are automatically LOCAL. You can read them just as any other variable, within the current scope, but must use LOCAL to change their value. If you set their value without LOCAL you will simply create a copy of the local variable in the global scope instead. Most of the time, this is not what you intended to do.

Clone this wiki locally