Call

Executes an ACUCOBOL-GT program.

Usage:

public unsafe errorTypes Call (string        pgmName, 
                               ref object[]  CobolParams,
                               ref byte[]    CobolTypes,
                               string        CallOptions,  
                               ref int       ProgramReturnCode)

where:

Variable Definition
pgmName Is the file path of an ACUCOBOL-GT program.
CobolParams Is an array of parameter objects. They must match the Procedure Division USING parameters and be native types int, uint, short, ushort, long, ulong, float, double, char, byte, and/or string. Parameters should correspond one-to-one with the Linkage section of the COBOL program.
CobolTypes Is an array of COBOL types. This field is optional, meaning it can be a null reference. When used, it must be allocated with the same number of entries as CobolParams, one type corresponding to each parameter. These entries are needed when a COBOL program has a mix of unicode, double byte, and ANSI strings. .NET treats all strings as unicode and "wrunnet", by default, converts them to ANSI strings. In order for "wrunnet" to convert the unicode to a wide character, double byte, or pass it as a unicode string to a COBOL program, the corresponding entry in CobolTypes must be set.

If all strings in the COBOL program are unicode or all are double byte, a property may be set. This field is automatically generated when using the compiler option, "--netdll". The applicable fields are NAT, NATJ, NATE, WID, WIDJ and EWID. See CompilerTypes for more information.

CallOptions The following runtime options can be set using the Call method:
  • "-d", debug
  • "-show", display error text
  • " -uni", unicode
  • "-wide", double byte characters
  • "-cache", cache program
  • These are the only options that can be set after Initialize is called. They may also be set using a property assignment before a Call is executed. For example:

    "-d 1" or "-d 0" turns debug mode on in the first instance and off in the second instance.

    This is the only place where a boolean option can be set on and off in this manner. All other boolean options set via Initialize can be turned only on. In this case the syntax does not include a "1" or "0".

ProgramReturnCode     Upon return from Call, ProgramReturnCode contains the COBOL program return code.