BEGIN SCOPE
statements
END SCOPE
statements | Code including one or more LOCAL declarations. |
BEGIN SCOPE...END SCOPE are used within a function/member body to define an area of restricted scope for LOCAL variables. Attempt to use a LOCAL variable that is declared with a BEGIN SCOPE...END SCOPE block outside the scope results in a compiler error.
Example
FUNCTION Test() AS VOID
BEGIN SCOPE
LOCAL n AS INT
n++
? n
END SCOPE
// n does not exist here