Compaq AAQ2G1FTK Marine Radio User Manual


 
Interprogram Communication
12.6 Calling Compaq COBOL Programs from Other Languages
[Windows NT] c:\> cobol -c progmain.cob progcob.cob
c:\> cl -c progc.c
c:\> cobol progmain.obj progcob.obj progc.obj (*)
c:\> progmain
The order of listing at (*) is fundamental. Here is a sample run:
[0] All the initialized values
==============================
retval = 0
arg1 = 1
+------------------- From COBOL --------------------
| myVal = 0
| arg1 = 1
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+ After add arg1 arg2 arg3 arg4 giving arg1 myVal:
| myVal = 10
| arg1 = 10
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+---------------------------------------------------
[1] After calling cobcall:
==========================
retval = 987654321
arg1 = 10
+------------------- From COBOL --------------------
| myVal = 10
| arg1 = 10
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+ After add arg1 arg2 arg3 arg4 giving arg1 myVal:
| myVal = 19
| arg1 = 19
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+---------------------------------------------------
[2] After calling cobfunc:
==========================
retval = 987654321
arg1 = 19
+------------------- From COBOL --------------------
| myVal = 0
| arg1 = 19
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+ After add arg1 arg2 arg3 arg4 giving arg1 myVal:
| myVal = 28
| arg1 = 28
| arg2 = 2
| arg3 = 3
| arg4 = 4
| retVal = 987654321
+---------------------------------------------------
1224 Interprogram Communication