Let’s start with a simple example.
Declaring Local Variables
Today variables are declared in the local-storage section of a method:
In the next release of Visual COBOL you will be able to declare them within the procedure division body of your method.
Optionally, you will be able to assign a value to the variable during declaration :
The same principle applies to framework types. For example, declaring the .NET Class Library structure System.DateTime.
and again, optionally a value can be assigned on declaration:
Declaration of Iteration Variables
or
In the current product, the variables i and s have to be declared in the local-storage section of the method. But as shown above, in the next release, the iteration variables can be declared within the scope of the iterator.
Declaration of Exception Variables
Likewise, currently the exception variable e has to be declared in local-storage, but in the next release it can be delcared at point of use.
Scope
The scope of any in-line local variable is from the point of declaration until the end of the innermost containing block, where paragraphs, sections and the whole method are considered to be blocks.
NB. This new syntax will be available in Managed COBOL only.
And finally...
Your feedback is welcome.
#VisualCOBOL
#language
#Announcement
#VisualStudio
#.net
#COBOL
#Eclipse
#JVM
#Modernization
#development