Category : OS/2 Files
Archive   : OS2CMAPI.ZIP
Filename : HSMPLP.PAS

 
Output of file : HSMPLP.PAS contained in archive : OS2CMAPI.ZIP
(*********************************************************************)
(* *)
(* *)
(* FILE NAME: HSMPLP.PAS *)
(* *)
(* MODULE NAME= HSMPLP.PAS *)
(* *)
(* DESCRIPTIVE NAME= PASCAL SAMPLE PROGRAM FOR EHLLAPI *)
(* *)
(* Displays EHLLAPI and session information. *)
(* Writes string to host. *)
(* Searches for written string on host. *)
(* Displays host session screen. *)
(* *)
(* COPYRIGHT: XXXXXXXXX (C) COPYRIGHT IBM CORP. 1987,1988 *)
(* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM *)
(* ALL RIGHTS RESERVED *)
(* *)
(* *)
(* NOTES= *)
(* *)
(**********************-END OF SPECIFICATIONS-************************)
(*BEGINPDL (000,001) *)
(*ENDPDL *)
(*BEGINCDE *)
(*********************************************************************)
(*************************** BEGIN CODE ******************************)
(*********************************************************************)

(*********************************************************************)
(* MAIN - Main code calls routines to do real work. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(* *)
(*********************************************************************)
PROGRAM MAIN(INPUT, OUTPUT); (* 000 Entry from DOS. *)

(*********************************************************************)
(********************** BEGIN INCLUDE FILES **************************)
(*********************************************************************)


(*$INCLUDE:'HAPI_P.INC'*) (* 000 Get EHLLAPI *)
(* include file for PASCAL. *)




(*********************************************************************)
(*************************** CONSTANTS *******************************)
(*********************************************************************)
CONST
MAX_DATA_SIZE = 3840; (* 000 The maximum data *)
(* size for this *)
(* application. *)

EABS = 2#10000000; (* 000 Extended attribute *)
(* bit. *)
PSS = 2#01000000; (* 000 Programmed Symbol *)
(* Set bit. *)

PRESS_ENT_MSG = 'Press ENTER to continue...';

HOST_TEXT = '3270 EHLLAPI';(* 000 String to send to *)
(* host and to search *)
(* for. *)

HOME_KEY = '@0'; (* 000 The Home Key. *)

SETPARM_TEXT = 'NOATTRB EAB XLATE';
(* 000 Srting to to use *)
(* for set parms. *)





(*********************************************************************)
(****************************** TYPES ********************************)
(*********************************************************************)
TYPE
ARR_TYPE = ARRAY[1..3840] OF BYTE;



(*********************************************************************)
(****************************** EXTERNS ******************************)
(*********************************************************************)



PROCEDURE HLLPAS (VAR LIM_FUNC : INTEGER; (* LIM Call EXTERN. *)
VAR LIM_STR : STRING;
VAR LIM_LEN : INTEGER;
VAR LIM_RETC : INTEGER); EXTERN;


PROCEDURE VIOWRTCELLSTR (
VIO_STR : ADSMEM; (* String to be written *)
VIO_LEN : INTEGER; (* Length of string *)
VIO_ROW : INTEGER; (* Starting position for output (row) *)
VIO_COL : INTEGER; (* Starting position for output (col) *)
VIO_HAND : INTEGER); EXTERN; (* Vio Handle *)




(*********************************************************************)
(******************* BEGIN STATIC VARIABLES **************************)
(*********************************************************************)

VAR

DFT_SESS : CHAR; (* 000 Session to write *)
(* string to and search *)
(* from. *)





(* EHLLAPI variables. *)
HFUNC_NUM : INTEGER; (* 000 EHLLAPI function *)
(* number. *)
HDATA_STR : STRING(MAX_DATA_SIZE); (* 000 EHLLAPI data *)
(* string. *)
HDS_LEN : INTEGER; (* 000 EHLLAPI data *)
(* string length. *)
HRC : INTEGER; (* 000 EHLLAPI return *)
(* code. *)




(*********************************************************************)
(* BLANK_SCREEN -Blanks the screen. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(*********************************************************************)
PROCEDURE BLANK_SCREEN;

BEGIN
WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;
WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;
WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;
END;




(*********************************************************************)
(* ERROR_HAND - Error handler. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(*********************************************************************)
PROCEDURE ERROR_HAND(FUNC,RC: INTEGER); (* 000 Error handler. *)

BEGIN
WRITE('UNEXPECTED RETURN CODE ' ,RC:5,' from FUNCTION #',FUNC:5);




END;


(*********************************************************************)
(* DISP_HOST_SCR - Displays first 1920 bytes of host screen. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(*********************************************************************)
FUNCTION DISP_HOST_SCR : INTEGER; (* 000 Routine to *)
(* display host screen. *)


VAR

RC : INTEGER;

BEGIN

RC := 0;


HFUNC_NUM := HA_SET_SESSION_PARMS; (* 000 Issue Set session *)
(* Parms. *)


HDS_LEN := ORD(SIZEOF(SETPARM_TEXT));
(* 000 Only copy the *)
(* first 1920 bytes of *)
(* the PS. *)



MOVER(ADR(SETPARM_TEXT), ADR(HDATA_STR), SIZEOF(SETPARM_TEXT));

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN

HFUNC_NUM := HA_COPY_PS_TO_STR; (* 000 Issue Copy PS 2 str *)

HDS_LEN := MAX_DATA_SIZE; (* 000 Only copy the *)
(* first 1920 bytes of *)
(* the PS. *)

HRC := 1; (* 000 Set PS position to *)
(* top,left corner. *)


HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)
IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN
VIOWRTCELLSTR (ADS (HDATA_STR), MAX_DATA_SIZE, 0, 0, 0);
(* 000 Write the string *)
(* in color. *)
END
ELSE (* 000 Bad RC. *)
BEGIN
RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;

END
ELSE (* 000 Bad RC. *)
BEGIN
RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;

DISP_HOST_SCR := RC;

END;



(*********************************************************************)
(* SEARCH_STR_ON_HOST- SeaRChes for string on host. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(*********************************************************************)
FUNCTION SEARCH_STR_ON_HOST: INTEGER; (* 000 Routine to search *)
(* for string on host *)
(* session. *)


VAR

RC : INTEGER;

BEGIN

RC := 0;


HFUNC_NUM := HA_SEARCH_PS; (* 000 Issue seaRCh PS. *)

MOVER(ADR(HOST_TEXT), ADR(HDATA_STR), SIZEOF(HOST_TEXT));
(* 000 String to seaRCh for *)
(* on Host. *)

HDS_LEN := ORD(SIZEOF(HOST_TEXT)); (* 000 Set length of *)
(* string. minus null *)
(* char. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN
WRITE('Found string "');
WRITE(HOST_TEXT);
WRITELN('" at PS position ',HDS_LEN:5,'.');
WRITELN;
WRITELN;

END
ELSE
BEGIN
RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;
SEARCH_STR_ON_HOST := RC;

END;






(*********************************************************************)
(* WRITE_STR_2_HOST - Connects to first session and writes home_key *)
(* and string to host. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(*********************************************************************)
FUNCTION WRITE_STR_2_HOST: INTEGER; (* 000 Routine to *)
(* write string to host. *)

VAR

RC : INTEGER;

BEGIN

RC := 0;


HDATA_STR[1] := DFT_SESS; (* 000 Set session id to *)
(* connect. *)

HFUNC_NUM := HA_CONNECT_PS; (* 000 Issue Connect *)
(* Presentation Space. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN

HFUNC_NUM := HA_SENDKEY; (* 000 Issue sendkey. *)

MOVER(ADR(HOME_KEY), ADR(HDATA_STR), SIZEOF(HOME_KEY));
(* 000 String to send to *)
(* Host. *)

HDS_LEN := ORD(SIZEOF(HOME_KEY)); (* 000 Set length of *)
(* string. minus null *)
(* char. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN

HFUNC_NUM := HA_SENDKEY; (* 000 Issue sendkey. *)

MOVER(ADR(HOST_TEXT), ADR(HDATA_STR), SIZEOF(HOST_TEXT));
(* 000 String to send to *)
(* Host. *)

HDS_LEN := ORD(SIZEOF(HOST_TEXT));(* 000 Set length of *)
(* string. minus null *)
(* char. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good RC. *)
BEGIN
WRITELN ('Sent String to Host.');
WRITELN;
WRITELN;

END
ELSE (* 000 Bad RC. *)
BEGIN
RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;
END
ELSE
BEGIN

RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;
END
ELSE
BEGIN

RC := HRC; (* 000 Set RC. *)
ERROR_HAND(HFUNC_NUM, RC);
END;
WRITE_STR_2_HOST := RC;

END;



(*********************************************************************)
(* DISP_SESSION_INFO - CALLs EHLLAPI QUERY funtions and then displays*)
(* the requested session info. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(*********************************************************************)
FUNCTION DISP_SESSION_INFO : INTEGER; (* 000 Routine to display *)
(* Host session info. *)


TYPE

QSES_TYPE = ARRAY[1..500] OF QSES_STRUCT;



VAR

DATA_PTR : ADS OF QSES_TYPE;

SESS_STR : STRING(18);


SESS_STUC : ADS OF QSST_STRUCT;

RC : INTEGER;

I : INTEGER; (* Array index. *)

NUM_SESS : INTEGER; (* 000 Number of session *)
(* started. *)
BEGIN


SESS_STUC := ADS (SESS_STR);

RC := 0;

DATA_PTR := ADS (HDATA_STR);

WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;
WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;WRITELN;

WRITELN(' SESSION INFO');
WRITELN;

HFUNC_NUM := HA_QUERY_SESSIONS; (* 000 Issue query *)
(* sessions. *)

HDS_LEN := MAX_DATA_SIZE DIV 12 * 12;
(* 000 Make sure len is *)
(* multiple of 12. *)

I := 1; (* Initialize index to first *)
(* element. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good rc. *)
BEGIN
NUM_SESS := HDS_LEN; (* 000 Number of sessions *)
(* started. *)

WRITE('Number of started sessions = ',NUM_SESS:5);
WRITELN;
WRITELN;

WHILE ((I <= NUM_SESS) AND (RC = 0)) DO
(* 000 LOOP thru queried *)
(* sessions. *)
BEGIN
WRITELN('Session number : ',I:5);


WRITE('Session Long name : ');
WRITELN(DATA_PTR^[I].QSES_LONGNAME);


WRITE('Session Short name : ');
WRITELN(CHR(DATA_PTR^[I].QSES_SHORTNAME));


WRITE('Session Type : ');
WRITE(CHR(DATA_PTR^[I].QSES_SESTYPE));

WRITE(' = ');
IF (CHR(DATA_PTR^[I].QSES_SESTYPE) = 'H') THEN

BEGIN
WRITE('Host');

IF (DFT_SESS = CHR(0)) THEN (* 000 If first HOST not *)
(* set already *)
BEGIN

DFT_SESS := CHR(DATA_PTR^[I].QSES_SHORTNAME);
(* Set the session to *)
(* write string to. *)

END;
END;
IF (CHR(DATA_PTR^[I].QSES_SESTYPE) = 'P') THEN

BEGIN
WRITE('PC');
END;
WRITELN;



WRITELN('Session PS size : ',DATA_PTR^[I].QSES_PSSIZE:5);

HFUNC_NUM := HA_QUERY_SESSION_STATUS;
(* 000 Issue query *)
(* session status. *)

HDS_LEN := 18; (* 000 SET LENGTH. *)

SESS_STUC^.QSST_SHORTNAME := DATA_PTR^[I].QSES_SHORTNAME;
(* 000 Set the short *)
(* name. *)

HLLPAS(HFUNC_NUM, SESS_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good rc. *)
BEGIN


WRITELN('Session PS rows : ',SESS_STUC^.QSST_PS_ROWS:5);

WRITELN('Session PS columns : ',SESS_STUC^.QSST_PS_COLS:5);

WRITE('Session type 2 : ',CHR(SESS_STUC^.QSST_SESTYPE));

WRITE(' = ');
IF (CHR(SESS_STUC^.QSST_SESTYPE) = 'D') THEN

BEGIN
WRITE('DFT Host');
END;
IF (CHR(SESS_STUC^.QSST_SESTYPE) = 'P') THEN

BEGIN
WRITE('PC');
END;
WRITELN;

WRITE('Session supports Extended attributes (EABs)? : ');

IF ((SESS_STUC^.QSST_CHAR AND EABS) <> 0) THEN
(* 000 if eabs on. *)
BEGIN
WRITELN('YES');
END
ELSE (* 000 no eabs. *)
BEGIN
WRITELN('NO');
END;

WRITE('Session supports Program Symbols (PSS)? : ');

IF ((SESS_STUC^.QSST_CHAR AND PSS) <> 0)THEN
(* 000 if programmed *)
(* sysmbol set on. *)
BEGIN
WRITELN('YES');
END
ELSE (* 000 no PSS. *)
BEGIN
WRITELN('NO');

END;
WRITELN;
WRITELN;
WRITELN;
WRITE(PRESS_ENT_MSG);
READLN; (* 000 Make user press *)
WRITELN;
(* ENTER. *)
END
ELSE (* 000 Bad rc. *)
BEGIN

RC := HRC;

ERROR_HAND(HFUNC_NUM, RC);

END;
I := I +1;
END;

END

ELSE (* 000 Bad rc. *)
BEGIN

RC := HRC;

ERROR_HAND(HFUNC_NUM, RC);

END;
DISP_SESSION_INFO := RC;

END;




(*********************************************************************)
(* DISP_EHLLAPI_INFO - CALLs EHLLAPI QUERY_SYSTEM and then displays *)
(* the requested info. *)
(* *)
(* INPUT *)
(* *)
(* OUTPUT *)
(* *)
(*********************************************************************)
FUNCTION DISP_EHLLAPI_INFO : INTEGER; (* 000 Routine to display *)
(* EHLLAPI info. *)


VAR

DATA_PTR : ADS OF QSYS_STRUCT;

RC : INTEGER;

X : INTEGER;

BEGIN

RC := 0;

DATA_PTR := ADS HDATA_STR;


HFUNC_NUM := HA_QUERY_SYSTEM; (* 000 Issue query *)
(* system. *)

HLLPAS(HFUNC_NUM, HDATA_STR, HDS_LEN, HRC);
(* 000 Call EHLLAPI. *)

IF (HRC = HARC_SUCCESS) THEN (* 000 If good rc. *)
BEGIN

WRITELN(' EHLLAPI INFORMATION');
WRITELN;


WRITE(' EHLLAPI version : ');

WRITELN(CHR(DATA_PTR^.QSYS_HLLAPI_VER));

WRITE(' EHLLAPI level : ');

WRITELN(DATA_PTR^.QSYS_HLLAPI_LVL);

WRITE(' EHLLAPI release date : ');

WRITELN(DATA_PTR^.QSYS_HLLAPI_DATE);


WRITE(' EHLLAPI LIM version : ');

WRITELN(CHR(DATA_PTR^.QSYS_LIM_VER));

WRITE(' EHLLAPI LIM level : ');

WRITELN(DATA_PTR^.QSYS_LIM_LVL);

WRITE(' EHLLAPI hardware base : ');

WRITE(CHR(DATA_PTR^.QSYS_HARDWARE_BASE));

WRITE(' = ');
IF (CHR(DATA_PTR^.QSYS_HARDWARE_BASE) = 'A') THEN

BEGIN
WRITE('AT');
END;
IF (CHR(DATA_PTR^.QSYS_HARDWARE_BASE) = 'X') THEN

BEGIN
WRITE('XT');
END;
IF (CHR(DATA_PTR^.QSYS_HARDWARE_BASE) = 'S') THEN

BEGIN
WRITE('S/2');
END;
IF (CHR(DATA_PTR^.QSYS_HARDWARE_BASE) = 'Z') THEN

BEGIN
WRITE('(See System model/submodel below)');

END;
WRITELN;

WRITE(' EHLLAPI CTRL program type : ');

WRITE(CHR(DATA_PTR^.QSYS_CTRL_PROG_TYPE));

WRITE(' = ');
IF (CHR(DATA_PTR^.QSYS_CTRL_PROG_TYPE) = 'X') THEN

BEGIN
WRITE('OS/2');

END;
IF (CHR(DATA_PTR^.QSYS_CTRL_PROG_TYPE) = 'C') THEN

BEGIN
WRITE('3270 PC');

END;
IF (CHR(DATA_PTR^.QSYS_CTRL_PROG_TYPE) = 'W') THEN

BEGIN
WRITE('WSP');

END;
WRITELN;

WRITE(' EHLLAPI sequence number : ');

WRITELN(DATA_PTR^.QSYS_SEQ_NUM);


WRITE(' EHLLAPI CTRL program version : ');

WRITELN(DATA_PTR^.QSYS_CTRL_PROG_VER);


WRITE(' EHLLAPI PC session name : ');

WRITELN(CHR(DATA_PTR^.QSYS_PC_SNAME));

WRITE(' EHLLAPI extended error 1 : ');

WRITELN(DATA_PTR^.QSYS_ERR1);

WRITE(' EHLLAPI extended error 2 : ');

WRITELN(DATA_PTR^.QSYS_ERR2);


WRITE(' EHLLAPI system model/submodel: ');

X := ORD(DATA_PTR^.QSYS_SYS_MODEL);
WRITE(X:2:16);
X := ORD(DATA_PTR^.QSYS_SYS_SUBMODEL);
WRITE(X:2:16);
WRITE(' HEX = ');
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FC)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#00)) THEN

BEGIN
WRITE('Model PC AT');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FC)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#01)) THEN

BEGIN
WRITE('Model PC AT ENHANCED');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FC)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#02)) THEN

BEGIN
WRITE('Model PC XT Model 286');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FA)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#01)) THEN

BEGIN
WRITE('Model 25');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FA)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#00)) THEN

BEGIN
WRITE('Model 30');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FC)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#04)) THEN

BEGIN
WRITE('Model 50');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#FC)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#05)) THEN

BEGIN
WRITE('Model 60');
END;
IF ((DATA_PTR^.QSYS_SYS_MODEL = 16#F8)
AND (DATA_PTR^.QSYS_SYS_SUBMODEL = 16#00)) THEN

BEGIN
WRITE('Model 80');
END;

WRITELN;

WRITE(' EHLLAPI National Language : ');
WRITELN(DATA_PTR^.QSYS_PC_NLS:5);

WRITE(' EHLLAPI monitor type : ');

WRITE(CHR(DATA_PTR^.QSYS_MONITOR_TYPE));

WRITE(' = ');
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'M') THEN

BEGIN
WRITE('PC MONOCHROME');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'C') THEN

BEGIN
WRITE('PC CGA');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'E') THEN

BEGIN
WRITE('PC EGA');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'A') THEN

BEGIN
WRITE('PS MONOCHROME');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'V') THEN

BEGIN
WRITE('PS 8512');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'H') THEN

BEGIN
WRITE('PS 8514');
END;
IF (CHR(DATA_PTR^.QSYS_MONITOR_TYPE) = 'U') THEN

BEGIN
WRITE('UNKNOWN monitor type');
END;
WRITELN;
END
ELSE (* 000 Bad rc *)
BEGIN
RC := HRC;

ERROR_HAND(HFUNC_NUM, RC);

END;
DISP_EHLLAPI_INFO := RC;


END;







BEGIN

DFT_SESS := CHR(0);


BLANK_SCREEN; (* 000 Clear the screen. *)

HRC := DISP_EHLLAPI_INFO; (* 000 Call routine to *)
(* display EHLLAPI info. *)

IF (HRC = 0) THEN
BEGIN

WRITE(PRESS_ENT_MSG);
READLN; (* 000 Make user press *)
(* ENTER. *)

HRC := DISP_SESSION_INFO; (* 000 Call routine to *)
(* display Host session *)
(* info. *)
END;

IF (HRC = 0) THEN
BEGIN
IF (DFT_SESS <> CHR(0)) THEN (* 000 If at least 1 dft *)
(* session. *)
BEGIN

BLANK_SCREEN; (* 000 Clear the screen. *)
WRITE('Press ENTER to send string "');

WRITE(HOST_TEXT);
WRITE('" to session short name ');


WRITE(DFT_SESS);
WRITE('...');
READLN; (* 000 Make user press *)



HRC := WRITE_STR_2_HOST; (* 000 Call routine to *)
(* write string to host *)
(* session. *)
END
ELSE
BEGIN
WRITELN('NO DFT SESSION SESSION STARTED.');


HRC := 1; (* 000 Get out of *)
(* program. *)
END;


END;

IF (HRC = 0) THEN
BEGIN
WRITE('Press ENTER to search for string "');

WRITE(host_text);
WRITE('" on Host Presentation Space...');

READLN; (* 000 Make user press *)

HRC := SEARCH_STR_ON_HOST; (* 000 Call routine to *)
(* search for string on *)
(* host session. *)

END;

IF (HRC = 0) THEN

BEGIN
WRITE('Press ENTER to display first 1920 bytes of Host ');
WRITE('presentation space...');
READLN; (* 000 Make user press *)
(* ENTER. *)
HRC := DISP_HOST_SCR; (* 000 Call routine to *)
(* display Host session *)
(* screen. *)

END;
IF (HRC = 0) THEN

BEGIN
WRITE(
'SAMPLE PROGRAM DONE. To Exit Program Press ENTER...'
);
READLN; (* 000 Make user press *)
(* ENTER. *)

END;



END.






  3 Responses to “Category : OS/2 Files
Archive   : OS2CMAPI.ZIP
Filename : HSMPLP.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/