Context:
Classes ValueTypes Interfaces Enums Properties Indexers Fields
|
01 dAmount decimal. 01 asNames string occurs 5. 01 abFigures binary-long occurs any.
01 objMyType type MyType. 01 objDateTime type DateTime. *> .NET COBOL 01 objDateTime type java.util.Date. *> JVM COBOL
Where:
To define a namespace to represent long class names so that you need to type a short name only, use the ILUSING directive.
All the predefined COBOL data types and any further .NET COBOL types that you define are mapped onto the corresponding native managed type (.NET or JVM), but they must conform to the following rules. They:
Any COBOL data item that does not follow these rules, or is of any other category, is not considered to be a managed type (.NET or JVM) and is allocated by the Compiler within an internally managed byte array. COBOL pointer data items always point into one of these byte arrays.
In .NET COBOL, to refer to a generic type using the TYPE literal syntax, you enumerate the generic parameters within square brackets. The following example declares myNames as an item of type Dictionary (for .NET COBOL) or HashMap (for JVM COBOL), with both generic parameters set to string - System.String for .NET COBOL, and java.lang.String for JVM COBOL:
myNames type System.Collections.Generic.Dictionary[string, string]. *> .NET COBOL myNames type java.util.HashMap[string, string]. *> JVM COBOL
The keyword NULLABLE is used to define nullable types. It can only be used with value types.