Subject: | |
From: | |
Reply To: | |
Date: | Tue, 10 Jan 1995 18:45:00 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
ANOTHER GOODIE. THANKS TO RICH TRAPP.
[log in to unmask]
----------
>From: Rich Trapp
>To: lopezrod; rodolfo_lopez
>Cc: hp3000-l
>Subject: Re: PROGRAMMATIC PAUSE IN COBOL
>Date: Tue, Jan 10, 1995 6:03PM
>
>
>Rodolfo Lopez asks;
>>
>> 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.
>>
>> [log in to unmask]
>
>Yes!
> From my stint at the HP Response Center (greetings to my former
fellows!),
>
>I've got several sample COBOL routines to do this. Here's my favorite one,
>which uses HPEXTIN to convert a string to a REAL value:
>
><much COBOLeez omitted>
> WORKING-STORAGE SECTION.
>
> 01 string-num pic x(5) value "00005".
> 01 string-len pic s9(4) comp value 5.
> 01 decplaces pic s9(4) comp value 0.
> 01 datatype pic s9(4) comp value 1.
> 01 scale pic s9(4) comp value 0.
> 01 delims pic s9(4) comp value 0.
> 01 pause-value pic x(4) value "xxxx".
> 01 error1 pic s9(4) comp value 0.
> 01 d-error pic 9(5) value 0.
>
>
><somewhere in PROCEDURE DIVISION land >
>
> CALL INTRINSIC "HPEXTIN" USING string-num, string-len,
> decplaces, datatype, scale, delims, pause-value, error1.
>
> if cc not equal zero
> display "Error on HPEXTIN call"
> move error1 to d-error
> display "Error = " d-error
> goback.
>
> CALL INTRINSIC "PAUSE" USING pause-value.
>
>To change the value, simply change the text in "string-num" to the
>number of seconds.
>
>There are several examples of this on HP SupportLine as well.
>Rich
>
|
|
|