Warning, '...' is implicitly declared local to procedure '...'
|
Description
|
|
Maple displays this warning when you do not declare a variable as local or global, and it is assumed to be local. Unless otherwise declared, each variable to which an assignment is made, or that appears as the controlling variable in a loop, is assumed to be local. All other undeclared variables are assumed to be global. No warnings are displayed for variables assumed to be global.
For details, see the procedure help page.
|
|
Examples
|
|
Create a procedure that increments . For example, can be a global counter that increments every time is called.
>
|
|
| (2.1) |
>
|
|
| (2.2) |
Solution
In most cases the warning can be ignored. However, it is better to declare all variables local or global explicitly.
To use to modify the global variable (as in the example), heed to the warning.
>
|
|
| (2.3) |
Call .
>
|
|
| (2.4) |
Note that did not change.
>
|
|
| (2.5) |
|
|
Download Help Document
Was this information helpful?