home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
TXCHEK.ZIP
/
PROFCHEK.CBL
next >
Wrap
Text File
|
1990-07-06
|
5KB
|
121 lines
$SET ANS85
******************************************************************
* *
* PROFCHEK - use EHHLAPI to examine OS/2 EE Comms Manager *
* Presentation Space before invoking SEND (which can hang *
* if IND$FILE cannot be executed at the host). *
* *
* Compile this with Micro Focus COBOL/2 v1.2 or above *
* *
******************************************************************
* *
* return-code = 0 means at profs main menu (or interrupt) *
* 10 means other mainframe menu *
* 20 means HLLAPI not working *
* *
******************************************************************
* *
* use this program in a batch file thus: *
* *
* @profchek *
* @if errorlevel 10 goto donothing *
* send %1.%2 %1 %2 (ascii crlf lrecl 80 *
* :donothing *
* *
******************************************************************
* *
* use the following as a DEF file when linking: *
* *
* NAME profchek NOTWINDOWCOMPAT *
* PROTMODE *
* STACKSIZE 16384 *
* IMPORTS *
* ACS3EHAP.HLLAPI *
* *
******************************************************************
program-id. progchek.
special-names.
call-convention 3 is os2api.
working-storage section.
01 h-fun pic xx comp-5.
01 h-len pic xx comp-5.
01 h-rc pic xx comp-5.
01 h-dat pic x(1920).
78 flag-true value 1.
78 flag-false value 0.
01 main-menu-flag pic 9.
88 main-menu value flag-true.
procedure division.
move flag-false to main-menu-flag
move zero to h-rc.
*
* Connect to Presentation Space "A"
*
move 1 to h-fun
h-len
move "A" to h-dat
perform call-hll-api
*
* Copy Presentation Space to string
*
move 5 to h-fun
move 1920 to h-len
move space to h-dat
perform call-hll-api
*
* Check for main menu label
*
if (h-dat (78:3) = "A00"
or h-dat (78:3) = "S00")
move flag-true to main-menu-flag
else
perform make-beep
display "profs menu: " h-dat (78:3)
end-if
*
* Disconnect Presentation Space
*
move 2 to h-fun
move zero to h-len
perform call-hll-api
*
* Return the result
*
if main-menu
move 0 to return-code
else
move 10 to return-code
end-if
stop run.
*****************************************************************
*
* SUBROUTINES
*
*****************************************************************
call-hll-api.
call os2api "__hllapi" using by reference h-fun
by reference h-dat
by reference h-len
by reference h-rc
if h-rc not = zero
display "hllapi return code bad: " h-rc
move 20 to return-code
stop run
end-if
exit.
make-beep.
call os2api "__dosbeep" using by value 1046 size 2
by value 200 size 2
exit.