The ACUCOBOL-GT product allows the user to introduce new command-line arguments that can be passed to the ACUCOBOL-GT runtime. The function exam_args() defined in ACUCOBOL-GT's interface to C module sub.c is called immediately upon startup and is passed the command-line arguments that were passed to the runtime.
The c-tree module ctreeacu.c contains the function ct_exam_args() that provides support for ‑‑setenv command-line argument. The ‑‑setenv command-line argument can be used to set environment variables once the ACUCOBOL-GT runtime has already been started.
To add support for ‑‑setenv command-line argument, edit the sub.c module located in the ACUCOBOL-GT lib directory, for example: /usr/acucbl810/acugt/lib.
int ct_exam_args(int argc, char *argv[]);
int
exam_args(int argc, char *argv[])
{
return 0;
} /* exam_args */
int
exam_args(int argc, char *argv[])
{
return ct_exam_args(argc, argv);
} /* exam_args */
Once the ACUCOBOL-GT runtime supports the --setenv command-line argument, you can call the runtime passing ‑‑setenv:variable=value, for example:
Windows
wrun32.exe cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE
Unix
runcbl cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE