When I write free rpg code in VS Code (with the usual extensions for IBM i), I get a warning that subroutines should not be declared in the global scope.
I want to keep working with subroutines, only using procedures when needed.
When I write free rpg code in VS Code (with the usual extensions for IBM i), I get a warning that subroutines should not be declared in the global scope.
I want to keep working with subroutines, only using procedures when needed.
On
All,
sorry as I may have posted this question prematurely. I found the answer to my own question, and maybe this will help others.
The solution is alter a line in the lint code:
{
"indent": 2,
"PrototypeCheck": true,
"NoOCCURS": true,
"NoSELECTAll": true,
"UppercaseConstants": true,
"IncorrectVariableCase": true,
"NoSQLJoins": true,
"PrettyComments": true,
**"NoGlobalSubroutines": false**,
"NoExternalTo": [
"QCMD",
"QP2TERM",
"QSH",
"SYSTEM",
"QCMDEXC"
]
}
I did restart VSCode to make sure it was active.
To avoid such a warning in a full free RPG, you can do this:
This way you can use subroutines inside Main (as well as inside any other procedure) and they won't be in the global scoupe