The NETDEFGEN COPY file contains methods for classes within NameSpaces. These are the program functions for that .NET object. For example:
METHOD, 0, "@TypesTest" "unsigned int" @someUint, TYPE 19 "single" @someFloat, TYPE 4 "unsigned char" @someByte, TYPE 17 "double" @someDouble, TYPE 5 "boolean" @someBool, TYPE 11 RETURNING "int", TYPE 3
Use the COBOL MODIFY statement to execute a method. The RETURNING value of any field in the parameter list may be updated and returned to the COBOL program. Update fields, IN/OUT, can be identified by types in the 16000 range. For example:
"int" @somefield TYPE 16387
Be aware that the compiler does not always know which method declaration to use when methods are overloaded. In your COBOL program, be sure to use COBOL types that match the COPY file method declaration.
Listed below are some guidelines on passing parameters to methods. Following these guidelines should help you ensure that the correct overloaded definition is compiled.
BOOL-PARAM PIC 9. "@methodname" (BOOL-PARAM AS VT_BOOL)
or as a constant. For example, 00 = false, 01 = true.
"@methodname" (01)
When casting data types is required, you must refer to the ACUCOBOL-GT provided COPY file "activex.def" in the Working-Storage section of your program.
SBYTE-PARAM USAGE SIGNED-INT. "@methodname" (SBYTE-PARAM AS VT-I1)
DATE-PARAM USAGE DOUBLE. "@methodname" (DATE-PARAM AS VT-DATE)
For more examples of these and other forms of .NET method calls, see the sample application "MethodTests" in your Acucorp \sample\dotnet directory.