https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/52173&feed=atom&action=historyMicrosoft KB Archive/52173 - Revision history2024-03-29T11:45:33ZRevision history for this page on the wikiMediaWiki 1.39.3https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/52173&diff=440946&oldid=prevX010: X010 moved page Microsoft KB Archive/Q52173 to Microsoft KB Archive/52173 without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/"2020-08-12T18:25:25Z<p>X010 moved page <a href="/wiki/index.php?title=Microsoft_KB_Archive/Q52173&action=edit&redlink=1" class="new" title="Microsoft KB Archive/Q52173 (page does not exist)">Microsoft KB Archive/Q52173</a> to <a href="/wiki/index.php?title=Microsoft_KB_Archive/52173" title="Microsoft KB Archive/52173">Microsoft KB Archive/52173</a> without leaving a redirect: Text replacement - "Microsoft KB Archive/Q" to "Microsoft KB Archive/"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en-GB">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:25, 12 August 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en-GB"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>X010https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/52173&diff=338770&oldid=prevX010: Text replacement - ">" to ">"2020-07-21T09:28:31Z<p>Text replacement - ">" to ">"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:28, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Code Example ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Code Example ==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The following COBOL program is COB.CBL, which invokes a C function to compute the area of a circle. It then displays the long integer returned by the C function: $SET LITLINK $SET RTNCODE-SIZE(4) IDENTIFICATION DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 PASS-VAR PIC 9(4) COMP-5. PROCEDURE DIVISION. DISPLAY “Radius of circle?”. ACCEPT PASS-VAR. CALL “C_Area” USING BY VALUE PASS-VAR. DISPLAY “Area of circle:” RETURN-CODE. STOP RUN. The following program is C.C, which computes the area of a circle from a passed radius and returns the area to the calling COBOL program: #include <stdio.h<del style="font-weight: bold; text-decoration: none;">&gt; </del>long Area(int Radius) { float cir; cir = 3.14159 * Radius * Radius; return((long) cir); } To demonstrate these programs from an .EXE program, compile and link as follows: COBOL COB.CBL; CL /c /Awlf C.C ; LINK /NOE COB MINITC C,,,LCOBOL LLIBCE; COB.EXE produces the following output: Radius of circle? 110 Area of circle: +000038013</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The following COBOL program is COB.CBL, which invokes a C function to compute the area of a circle. It then displays the long integer returned by the C function: $SET LITLINK $SET RTNCODE-SIZE(4) IDENTIFICATION DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 PASS-VAR PIC 9(4) COMP-5. PROCEDURE DIVISION. DISPLAY “Radius of circle?”. ACCEPT PASS-VAR. CALL “C_Area” USING BY VALUE PASS-VAR. DISPLAY “Area of circle:” RETURN-CODE. STOP RUN. The following program is C.C, which computes the area of a circle from a passed radius and returns the area to the calling COBOL program: #include <stdio.h<ins style="font-weight: bold; text-decoration: none;">> </ins>long Area(int Radius) { float cir; cir = 3.14159 * Radius * Radius; return((long) cir); } To demonstrate these programs from an .EXE program, compile and link as follows: COBOL COB.CBL; CL /c /Awlf C.C ; LINK /NOE COB MINITC C,,,LCOBOL LLIBCE; COB.EXE produces the following output: Radius of circle? 110 Area of circle: +000038013</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright Microsoft Corporation 1991.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright Microsoft Corporation 1991.</div></td></tr>
</table>X010https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/52173&diff=308533&oldid=prevX010: Text replacement - "<" to "<"2020-07-21T08:34:18Z<p>Text replacement - "<" to "<"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:34, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Code Example ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Code Example ==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The following COBOL program is COB.CBL, which invokes a C function to compute the area of a circle. It then displays the long integer returned by the C function: $SET LITLINK $SET RTNCODE-SIZE(4) IDENTIFICATION DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 PASS-VAR PIC 9(4) COMP-5. PROCEDURE DIVISION. DISPLAY “Radius of circle?”. ACCEPT PASS-VAR. CALL “C_Area” USING BY VALUE PASS-VAR. DISPLAY “Area of circle:” RETURN-CODE. STOP RUN. The following program is C.C, which computes the area of a circle from a passed radius and returns the area to the calling COBOL program: #include <del style="font-weight: bold; text-decoration: none;">&lt;</del>stdio.h&gt; long Area(int Radius) { float cir; cir = 3.14159 * Radius * Radius; return((long) cir); } To demonstrate these programs from an .EXE program, compile and link as follows: COBOL COB.CBL; CL /c /Awlf C.C ; LINK /NOE COB MINITC C,,,LCOBOL LLIBCE; COB.EXE produces the following output: Radius of circle? 110 Area of circle: +000038013</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The following COBOL program is COB.CBL, which invokes a C function to compute the area of a circle. It then displays the long integer returned by the C function: $SET LITLINK $SET RTNCODE-SIZE(4) IDENTIFICATION DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 PASS-VAR PIC 9(4) COMP-5. PROCEDURE DIVISION. DISPLAY “Radius of circle?”. ACCEPT PASS-VAR. CALL “C_Area” USING BY VALUE PASS-VAR. DISPLAY “Area of circle:” RETURN-CODE. STOP RUN. The following program is C.C, which computes the area of a circle from a passed radius and returns the area to the calling COBOL program: #include <ins style="font-weight: bold; text-decoration: none;"><</ins>stdio.h&gt; long Area(int Radius) { float cir; cir = 3.14159 * Radius * Radius; return((long) cir); } To demonstrate these programs from an .EXE program, compile and link as follows: COBOL COB.CBL; CL /c /Awlf C.C ; LINK /NOE COB MINITC C,,,LCOBOL LLIBCE; COB.EXE produces the following output: Radius of circle? 110 Area of circle: +000038013</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright Microsoft Corporation 1991.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Copyright Microsoft Corporation 1991.</div></td></tr>
</table>X010https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/52173&diff=246538&oldid=prev3155ffGd: importing KB archive2020-07-18T17:56:30Z<p>importing KB archive</p>
<p><b>New page</b></p><div>C Function Returning a Long Integer to COBOL<br />
<br />
PSS ID Number: Q52173 Article last modified on 01-09-1991<br />
<br />
3.00 3.00a MS-DOS<br />
<br />
Summary: The two programs shown below demonstrate how a Microsoft C function can return a long integer to COBOL. This information about interlanguage calling applies to Microsoft COBOL versions 3.00 and 3.00a for MS-DOS.<br />
<br />
More Information: For more examples of passing other types of parameters between COBOL and C, query on the following word: COB2C For a complete discussion about mixed-language programming with COBOL, search in the Software/Data Library for the following word: COBMIXED<br />
<br />
== Code Example ==<br />
<br />
The following COBOL program is COB.CBL, which invokes a C function to compute the area of a circle. It then displays the long integer returned by the C function: $SET LITLINK $SET RTNCODE-SIZE(4) IDENTIFICATION DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 PASS-VAR PIC 9(4) COMP-5. PROCEDURE DIVISION. DISPLAY “Radius of circle?”. ACCEPT PASS-VAR. CALL “C_Area” USING BY VALUE PASS-VAR. DISPLAY “Area of circle:” RETURN-CODE. STOP RUN. The following program is C.C, which computes the area of a circle from a passed radius and returns the area to the calling COBOL program: #include &lt;stdio.h&gt; long Area(int Radius) { float cir; cir = 3.14159 * Radius * Radius; return((long) cir); } To demonstrate these programs from an .EXE program, compile and link as follows: COBOL COB.CBL; CL /c /Awlf C.C ; LINK /NOE COB MINITC C,,,LCOBOL LLIBCE; COB.EXE produces the following output: Radius of circle? 110 Area of circle: +000038013<br />
<br />
Copyright Microsoft Corporation 1991.</div>3155ffGd