Microsoft KB Archive/40863

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ACCEPT FROM COMMAND-LINE Operates Like CALL "_MSCOMMAND"

PSS ID Number: Q40863 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

The information in this article applies to:
- Microsoft COBOL for MS-DOS and OS/2, versions 3.0 and 3.0a

Summary: The Microsoft COBOL Version 3.0 extension subroutine "_MSCOMMAND" replaces the extension “COMMAND” found in Microsoft COBOL Verions 2.x. The ACCEPT data-item FROM COMMAND-LINE statement also performs the same function. Either method is acceptable, and because the execution speed of both methods is virtually the same, the method of choice is a matter of preference. Below is an example of the ACCEPT FROM COMMAND-LINE method. For more information about the CALL "_MSCOMMAND" form, query the following keywords in this KnowledgeBase: CALL "_MSCOMMAND"

More Information: The command line used to invoke the program is stored in the data item ACCEPTed FROM the COMMAND-LINE. The program name is not included in the command line that is stored. More information can be found in the “Microsoft COBOL Version 3.0 Language Reference Manual” on Pages 3-87 and 3-96. The following are compile and LINK steps: COBOL example.cbl; LINK example; Run EXAMPLE.EXE as follows: EXAMPLE This is a test of command-line The program responds as follows: COMMAND LINE WAS this is the test of command-line The following is EXAMPLE.COB: $SET ANS85 WORKING-STORAGE SECTION. 01 COMM-LINE PIC X(80). PROCEDURE DIVISION. 000-MAIN. ACCEPT COMM-LINE FROM COMMAND-LINE. DISPLAY “COMMAND LINE WAS” COMM-LINE. STOP RUN.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.