Subject: | |
From: | |
Reply To: | |
Date: | Tue, 6 Jan 1998 07:47:17 -0800 |
Content-Type: | multipart/mixed |
Parts/Attachments: |
|
|
Jim Phillips writes:
What I would like to be able to do is either use REAL's from COBOL or
call
an intermediate intrinsic (like CPAUSE) that accepts a 32-bit integer and
converts it to REAL (to call PAUSE). You have proposed an interesting
idea,
it's just that I don't like multi-level mis-direction. If the purpose of
a call is to wait a specified number of seconds, then call the intrinsic
designed for that purpose and not another intrinsic which just happens
to
provide what you want as a byproduct.
------------------------------------------------------------------------------------
If you need to call the PAUSE intrinsic from COBOL, it can easily be done.
Attached is the working-storage and procedure division snippets to do
this. All you do is call the intrinsic (HPEXTIN or EXTIN') to convert a PIC
X(n) or PIC 9(n) DISPLAY to 32 bit real, and then use the result to call
PAUSE.
Mike Berkowitz
Guess? Inc.
001000 WORKING-STORAGE SECTION.
001100 77 PAUSE-SECONDS PIC 9(4).
001200 77 STRING-LENGTH PIC S9(4) COMP VALUE 4.
001300 77 SECS-REAL PIC S9(9) COMP.
001400 77 HPEXTIN-ERROR PIC S9(4) COMP.
001500
001600 PROCEDURE DIVISION.
001700 MOVE 4 TO PAUSE-SECONDS.
001800 CALL "HPEXTIN"
001900 USING PAUSE-SECONDS STRING-LENGTH 0 1 0 0 SECS-REAL
002000 HPEXTIN-ERROR.
002100
002200 IF HPEXTIN-ERROR NOT = 0
002300 DISPLAY "HPEXTIN FAILED"
002400 DISPLAY "ERROR IS " HPEXTIN-ERROR
002500 ELSE
002600 CALL INTRINSIC "PAUSE"
002700 USING SECS-REAL.
|
|
|