Subject: | |
From: | |
Reply To: | |
Date: | Wed, 11 Jan 1995 16:07:42 GMT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Rodolfo Lopez ([log in to unmask]) wrote:
: Is there any way of generating a programmatic Pause within a COBOLII
: program? The PAUSE intrinsic requires a 32-bit Real value as a passing
: parameter which COBOL does not support.
Hope I'm not beating a dead horse here. I like the following code,
because it works on MPE V as well as MPE/iX. It's from Engineer
Note A3043325 on HP SupportLine.
-----cut here-----
$CONTROL DYNAMIC
IDENTIFICATION DIVISION.
PROGRAM-ID. EZPAUSE.
*
* This is a "universal" subroutine for calling the PAUSE
* intrinsic from COBOL. This source file can be compiled
* in any of the following environments.
*
* * ANSI74 or ANSI85.
* * COBOL II on MPE V systems.
* * Compatibility mode COBOL II on MPE/iX systems.
* * Native mode COBOL II/iX on MPE/iX systems.
*
* The subroutine can reside in a USL, an RL, an SL,
* an NMOBJ file, or an XL. Or use this as sample code
* showing how to call PAUSE directly from your program.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
77 STRINGLEN PIC S9(4) COMP.
77 REAL-NUMBER PIC S9(9) COMP.
77 ERR-OR PIC S9(4) COMP.
LINKAGE SECTION.
77 PAUSE-SECONDS PIC 9(6).
PROCEDURE DIVISION USING PAUSE-SECONDS.
BEGIN.
CALL INTRINSIC ".LEN." USING PAUSE-SECONDS GIVING STRINGLEN.
CALL "HPEXTIN" USING
@PAUSE-SECONDS, STRINGLEN,
\0\, \1\, \0\, \0\,
REAL-NUMBER, ERR-OR.
CALL INTRINSIC "PAUSE" USING REAL-NUMBER.
EXIT PROGRAM.
-----cut here-----
Walter
|
|
|