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
+---------------------------------------------------
12–24 Interprogram Communication
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......