You are on page 1of 232

January 2000

for WINDOWS 2000


for WINDOWS NT 4.0
for WINDOWS 98
for WINDOWS 95

HLLAPI Reference
Manual

Reflection
WRQ

for IBM
Copyright
19942000 by WRQ, Inc. All rights reserved. No part of this publication may be reproduced, transmitted,
transcribed, stored in a retrieval system, or translated into any language, in any form by any means, without
the written permission of WRQ, Inc.

Reflection for IBM HLLAPI Help Reference Manual


Version 8.0
February 2000

Licenses and Trademarks


WRQ, the WRQ logo, and Reflection are trademarks of WRQ, Inc., registered in the USA and other countries. Reflection
Deploy and Reflection Signature are trademarks of WRQ, Inc. Reflection Deploy: Patent Pending.

Adobe Systems Incorporated Adobe, Acrobat, and Acrobat Reader are registered trademarks.

Compaq Computer Corporation DEC, LAT, VAX, and OpenVMS are registered trademarks.

Hewlett-Packard Company Hewlett-Packard, HP, and OpenMail are registered trademarks.

HiT Software, Inc. HiT Software, HiT ODBC, and HiT DB2 are trademarks.

INSO Corporation INSO is a registered trademark, and International Proofreader is a trademark.

International Business Machines Corporation AT, IBM, PS/2, IBM Communications Server for Windows NT,
and AS/400 are registered trademarks.

Microsoft Corporation Microsoft, MS-DOS, Windows, Windows NT, and Visual Basic are registered trademarks.

NCompass Labs, Inc. NCompass and DocActive are trademarks.

NetManage, Inc. NetManage and NS/Router are registered trademarks.

Novell, Inc. Novell and NetWare are registered trademarks.

The Open Company UNIX is a registered trademark.

All other brand and product names mentioned in this manual are the trademarks of their respective owners.
Customer Service
WRQ Corporate Headquarters European Headquarters
1500 Dexter Avenue North The Netherlands
Seattle, WA 98109 USA +31.70.375.11.00
+1.206.217.7100 +31.70.356.12.44 FAX
+1.206.217.0293 FAX
800.872.2829

Asia Pacific Headquarters


Singapore
+65.336.3122
+65.336.5233 FAX

Technical Support in the USA


WWW: support.wrq.com
Anonymous FTP Server: ftp.wrq.com
Technical Support: 206.217.7000
Technical Support Fax: 206.217.9492
For Partners of WRQ visit: www.wrq.com/bp/

Technical Support Outside the USA


Please contact your WRQ Worldwide Distributors: visit www.wrq.com/bp/intldist.htm,
or call WRQ for the name of the Business Partner nearest you. You can also send an e-mail
to wrqbp@wrq.com.

Technical Documentation
Visit the following Web site to download the PDF (Portable Document Format) version
of this and other WRQ manuals: support.wrq.com/manuals/.

We welcome suggestions on how to improve our printed and online documentation.


Send your comments to docs@wrq.com.
C HA PTE R
1
Reflection for IBM HLLAPI Reference
This manual contains printed copies of online help topics from the Reflection for IBM
HLLAPI Help Reference. If you wish to take full advantage of the Reflection for IBM
HLLAPI Help Reference, it is recommended you run the Hllapi.hlp file.

Table of Contents
Reflection for IBM HLLAPI Reference ........................................................................................................................ 1
HLLAPI Help Reference ........................................................................................................................................................ 5
EHLLAPI Functions Alphabetical List ................................................................................................................................ 6
EHLLAPI Functions Numerical List .................................................................................................................................... 8
Connect Presentation Space (1) ........................................................................................................................................10
Disconnect Presentation Space (2) ...................................................................................................................................12
Send Key (3) ............................................................................................................................................................................13
Wait (4) .....................................................................................................................................................................................15
Copy Presentation Space (5) ..............................................................................................................................................16
Search Presentation Space (6) ...........................................................................................................................................18
Query Cursor Location (7) ...................................................................................................................................................20
Copy Presentation Space to String (8) .............................................................................................................................21
Set Session Parameters (9) ..................................................................................................................................................23
Query Sessions (10) ...............................................................................................................................................................30
Reserve (11) ............................................................................................................................................................................31
Release (12) .............................................................................................................................................................................32
Copy OIA (13) .........................................................................................................................................................................33
Query Field Attribute (14) ...................................................................................................................................................42
Copy String to Presentation Space (15) ...........................................................................................................................44
Pause (18) ................................................................................................................................................................................46
Query System (20) .................................................................................................................................................................48
Reset System (21) ..................................................................................................................................................................49
Query Session Status (22) ....................................................................................................................................................51
Start Host Notification (23) .................................................................................................................................................53
Query Host Update (24) .......................................................................................................................................................54
Stop Host Notification (25) .................................................................................................................................................56

Project Name Chapter 1 Reflection for IBM HLLAPI Reference TEMPLATE: docs_v4 D:\working\hllapi\hllapi.fm 1.14.00 10:54am
2 Reflection for IBM HLLAPI Reference

Search Field (30) .................................................................................................................................................................... 57


Find Field Position (31) ........................................................................................................................................................ 59
Find Field Length (32) .......................................................................................................................................................... 61
Copy String to Field (33) ..................................................................................................................................................... 63
Copy Field to String (34) ..................................................................................................................................................... 65
Display Cursor (37) ............................................................................................................................................................... 67
Set Cursor (40) ....................................................................................................................................................................... 68
Start Close Intercept (41) .................................................................................................................................................... 69
Query Close Intercept (42) .................................................................................................................................................. 70
Stop Close Intercept (43) .................................................................................................................................................... 71
Start Keystroke Intercept (50) ............................................................................................................................................ 72
Get Key (51) ............................................................................................................................................................................ 74
Post Intercept Status (52) ................................................................................................................................................... 77
Stop Keystroke Intercept (53) ............................................................................................................................................ 78
Send File (90) ......................................................................................................................................................................... 79
Receive File (91) .................................................................................................................................................................... 81
Convert (99) ............................................................................................................................................................................ 82
Connect Window Services (101) ....................................................................................................................................... 84
Disconnect Window Services (102) .................................................................................................................................. 85
Query Window Coordinates (103) .................................................................................................................................... 86
Window Status (104) ............................................................................................................................................................ 87
Change PS Window Name (106) ....................................................................................................................................... 88
Run Profile (1000) ................................................................................................................................................................. 89
Get Session HWND (1002) .................................................................................................................................................. 91
EHLLAPI Return Codes ......................................................................................................................................................... 92
HLLAPI File Transfer with VM/CMS ................................................................................................................................... 94
File Transfer with VMS/TSO ................................................................................................................................................ 96
HLLAPI AID Keys .................................................................................................................................................................... 98
HLLAPI Window Status ........................................................................................................................................................ 99
HLLAPI ASCII Mnemonics .................................................................................................................................................... 104
Presentation Space Buffer Sizes ....................................................................................................................................... 107
WinHLLAPI Functions Alphabetical List .......................................................................................................................... 107
WinHLLAPI Functions Numerical List .............................................................................................................................. 109
Connect Presentation Space (1) ........................................................................................................................................ 111
Reflection for IBM HLLAPI Reference 3

Disconnect Presentation Space (2) .................................................................................................................................. 114


Send Key (3) ........................................................................................................................................................................... 115
Wait (4) .................................................................................................................................................................................... 117
Copy Presentation Space (5) .............................................................................................................................................. 119
Search Presentation Space (6) ........................................................................................................................................... 121
Query Cursor Location (7) ................................................................................................................................................... 123
Copy Presentation Space to String (8) ............................................................................................................................ 124
Set Session Parameters (9) ................................................................................................................................................. 126
Query Sessions (10) .............................................................................................................................................................. 133
Reserve (11) ............................................................................................................................................................................ 135
Release (12) ............................................................................................................................................................................ 136
Copy OIA (13) ......................................................................................................................................................................... 137
Query Field Attribute (14) ................................................................................................................................................... 147
Copy String to Presentation Space (15) .......................................................................................................................... 149
Pause (18) ............................................................................................................................................................................... 151
Query System (20) ................................................................................................................................................................ 153
Reset System (21) ................................................................................................................................................................. 155
Query Session Status (22) ................................................................................................................................................... 157
Start Host Notification (23) ................................................................................................................................................. 159
Query Host Update (24) ...................................................................................................................................................... 161
Stop Host Notification (25) ................................................................................................................................................. 163
Search Field (30) .................................................................................................................................................................... 164
Find Field Position (31) ........................................................................................................................................................ 166
Find Field Length (32) .......................................................................................................................................................... 168
Copy String to Field (33) ..................................................................................................................................................... 170
Copy Field to String (34) ..................................................................................................................................................... 172
Display Cursor (37) ............................................................................................................................................................... 174
Set Cursor (40) ....................................................................................................................................................................... 175
Start Close Intercept (41) .................................................................................................................................................... 176
Query Close Intercept (42) .................................................................................................................................................. 178
Stop Close Intercept (43) .................................................................................................................................................... 179
Start Keystroke Intercept (50) ............................................................................................................................................ 181
Get Key (51) ............................................................................................................................................................................ 183
Post Intercept Status (52) ................................................................................................................................................... 186
Stop Keystroke Intercept (53) ............................................................................................................................................ 187
Send File (90) ......................................................................................................................................................................... 189
Receive File (91) .................................................................................................................................................................... 192
4 Reflection for IBM HLLAPI Reference

Convert (99) ............................................................................................................................................................................ 194


Connect Window Services (101) ....................................................................................................................................... 196
Disconnect Window Services (102) .................................................................................................................................. 197
Query Window Coordinates (103) .................................................................................................................................... 198
Window Status (104) ............................................................................................................................................................ 199
Change PS Window Name (106) ....................................................................................................................................... 200
Run Profile (1000) ................................................................................................................................................................. 202
Get Session HWND (1002) .................................................................................................................................................. 204
WinHLLAPI Return Codes .................................................................................................................................................... 205
File Transfer with VM/CMS ................................................................................................................................................. 208
File Transfer with VMS/TSO ................................................................................................................................................ 210
WinHLLAPI AID Keys ............................................................................................................................................................. 212
WinHLLAPI Window Status ................................................................................................................................................ 213
WinHLLAPI ASCII Mnemonics ............................................................................................................................................ 218
Presentation Space Buffer Sizes ........................................................................................................................................ 221
WinHLLAPI Character and Field Attributes .................................................................................................................... 221
OIA Image Symbols for 3270 Sessions ............................................................................................................................. 226
WinHLLAPI Prerequisite Functions ................................................................................................................................... 227
Reflection for IBM HLLAPI Reference 5
HLLAPI Reference

HLLAPI Help Reference


The Reflection for IBM HLLAPI Help Reference describes the HLLAPI functions supported by
Reflection for IBM version 7.0 and above. Descriptions include function definition, supported
parameters, return codes, and prerequisite functions. Reflection supports these implementations
of IBMs High-Level Language Application Program Interface known as HLLAPI:

Microsofts Windows HLLAPI (WinHLLAPI) for 3270 and 5250 sessions.

IBMs 32-bit HLLAPI specification.

DOS HLLAPI support for 3270 sessions running under Windows 95 and Windows NT.

Support of proprietary HLLAPI and Windows HLLAPI functions of other PC-to-host


connectivity vendors, including the Wall Data subset (functions beginning with WD_)
and the Attachmate subset (functions beginning with HLL_).

For both 3270 and 5250 sessions, you can create and use HLLAPI applications that communicate
with a host through Reflection, connect multiple HLLAPI applications, and connect 16-bit
HLLAPI applications to Reflection.
Registering 32-bit HLLAPI Applications
If you have HLLAPI applications that use IBMs 32-bit HLLAPI specification, you must register
them using the Reflection HLLAPI Application Setup Utility. Adding your HLLAPI applications
to the Windows registry tells Reflection to use the IBM 32-bit HLLAPI specification for these
applications rather than the 16-bit HLLAPI specification.

Reflection continues to support HLLAPI applications that use the 16-bit HLLAPI interface and
provides the unique ability to simultaneously run applications that use the new 32-bit specifi-
cation and the 16-bit specification.

The Reflection HLLAPI Application Setup utility (Hllsetup.exe) is installed in the main
Reflection folder. Refer to HLLAPI Application Setup utilitys online help for help registering
your HLLAPI applications.

Click one of the following:


Function Reference
EHLLAPI Functions
EHLLAPI Return Codes
WinHLLAPI Functions
WinHLLAPI Return Codes
6 Reflection for IBM HLLAPI Reference

HLLAPI Reference

EHLLAPI Functions Alphabetical List

Click an EHLLAPI function below for a complete description:

Change PS Window Name (106)


Connect Presentation Space (1)
Connect Window Services (101)
Convert (99)
Copy Field to String (34)
Copy OIA (13)
Copy Presentation Space (5)
Copy Presentation Space to String (8)
Copy String to Field (33)
Copy String to Presentation Space (15)
Disconnect Presentation Space (2)
Disconnect Window Services (102)
Display Cursor (37)
Find Field Length (32)
Find Field Position (31)
Get Key (51)
Get Session HWND (1002)
Pause (18)
Post Intercept Status (52)
Query Close Intercept (42)
Query Cursor Location (7)
Query Field Attribute (14)
Query Host Update (24)
Query Session Status (22)
Query Sessions (10)
Query System (20)
Query Window Coordinates (103)
Receive File (91)
Release (12)
Reserve (11)
Reset System (21)
Run Profile (1000)
Search Field (30)
Reflection for IBM HLLAPI Reference 7

Search Presentation Space (6)


Send File (90)
Send Key (3)
Set Cursor (40)
Set Session Parameters (9)
Start Close Intercept (41)
Start Host Notification (23)
Start Keystroke Intercept (50)
Stop Close Intercept (43)
Stop Host Notification (25)
Stop Keystroke Intercept (53)
Wait (4)
Window Status (104)
8 Reflection for IBM HLLAPI Reference

HLLAPI Reference

EHLLAPI Functions Numerical List

Click an EHLLAPI function below for a complete description:

Connect Presentation Space (1)


Disconnect Presentation Space (2)
Send Key (3)
Wait (4)
Copy Presentation Space (5)
Search Presentation Space (6)
Query Cursor Location (7)
Copy Presentation Space to String (8)
Set Session Parameters (9)
Query Sessions (10)
Reserve (11)
Release (12)
Copy OIA (13)
Query Field Attribute (14)
Copy String to Presentation Space (15)
Pause (18)
Query System (20)
Reset System (21)
Query Session Status (22)
Start Host Notification (23)
Query Host Update (24)
Stop Host Notification (25)
Search Field (30)
Find Field Position (31)
Find Field Length (32)
Copy String to Field (33)
Copy Field to String (34)
Display Cursor (37)
Set Cursor (40)
Start Close Intercept (41)
Query Close Intercept (42)
Stop Close Intercept (43)
Start Keystroke Intercept (50)
Reflection for IBM HLLAPI Reference 9

Get Key (51)


Post Intercept Status (52)
Stop Keystroke Intercept (53)
Send File (90)
Receive File (91)
Convert (99)
Connect Window Services (101)
Disconnect Window Services (102)
Query Window Coordinates (103)
Window Status (104)
Change PS Window Name (106)
Run Profile (1000)
Get Session HWND (1002)
10 Reflection for IBM HLLAPI Reference

HLLAPI Function

Connect Presentation Space (1)

Description
Connect Presentation Space connects and links a HLLAPI application to an RIBM Presentation
Space (PS). Reflection allows up to 16 RIBM presentation spaces to be run simultaneously.
Prerequisite
An RIBM presentation space must be configured with a unique short name before any HLLAPI
applications can connect to it.
Call Parameters
Your client application program must pass the following parameters to this function:

Function number 1
Data string A letter of the alphabet (A-Z) which represents the RIBM
presentation space short name.
Data length Not applicable.
PS position Not applicable.

Return Codes

0 APIOK Function was successfully completed. The RIBM presentation


space is ready for input.
1 APINOTCONNECTED The specified RIBM presentation space is invalid. Check the
RIBM Terminal Setup dialog for the correct HLLAPI short
name.
4 APIPSBUSY Successful connection, but RIBM presentation space is busy.
5 APIINHIBITED Successful connection, but RIBM presentation space is locked.
9 APISYSERROR System Error.
11 APIUNAVAILABLE RIBM presentation space is in use by another ssession and
unavailable.
Reflection for IBM HLLAPI Reference 11

Remarks
Connect Presentation Space (1) connects you to one RIBM presentation space. If a HLLAPI
application tries to connect to a new RIBM presentation space while already connected, the
application will be disconnected and then the application will attempt to connect to the new
RIBM RIBM presentation space. The application will be disconnected from the old RIBM
presentation space even if ConnectPS does not complete successfully.
The following functions disconnect the client application from the connected RIBM presen-
tation space:

Disconnect Presentation Space (2)

Reset System (21)


The functions below require that client programs first make a prerequisite call to the Connect
Presentation Space function.

Function 2 Disconnect Presentation Space


Function 3 Send Key
Function 4 Wait
Function 5 Copy PS
Function 6 Search PS
Function 7 Query Cursor Location
Function 8 Copy PS to String
Function 11 Reserve
Function 12 Release
Function 13 Copy OIA
Function 14 Query Field Attribute
Function 15 Copy String to PS
Function 30 Search Field
Function 31 Find Field Position
Function 32 Find Field Length
Function 33 Copy String to Field
Function 34 Copy Field to String
Function 40 Set Cursor
12 Reflection for IBM HLLAPI Reference

HLLAPI Function

Disconnect Presentation Space (2)

Description
Disconnect Presentation Space (2) disconnects your client application from its currently
connected RIBM presentation space.

After calling this function, you cannot call functions that depend on a connection to an RIBM
presentation space: You will be automatically disconnected from your currently connected RIBM
presentation space when you connect to another presentation space.

Your client application should always disconnect when exiting.


Prerequisite
Connect Presentation Space (1)
Call Parameters
Function Number2

Data String Not applicable

Length Not applicable

PS Position Not applicable


Return Codes

0 APIOK Successful disconnect


1 APINOTCONNECTED Client is currently not connected to any presentation space
9 APISYSERROR System error

Remarks
Disconnect Presentation Space (2) does not restore the values in Set Session Parameters (9) when
you exit the client application. You may call the Reset System (21) function to restore to the
default values.
Reflection for IBM HLLAPI Reference 13

HLLAPI Function

Send Key (3)

Description
Send Key (3) is used to send a string of up to 255 keystrokes to the currently connected RIBM
presentation space as if they had been entered by an operator. The keyboard must be unlocked
and not in a busy state. Send Key (3) allows sessions to exchange keystrokes that are not available
from the keyboard, or are not represented by an ASCII value. For example, an operator may not
be able to produce the keystrokes necessary for a session, so Send Key (3) can produce the appro-
priate keystroke.
Prerequisites
Connect Presentation Space (1).
Call Parameters

Function Number 3
Data String The string can be a maximum of 255 characters including
keystrokes and ASCII mnemonics which the client sends to
host presentation space.
Length String length, if STRLEN is used. Not used if STREOT
option is used and in such case, the string must end with an
EOT.
PS Position Not applicable

Return Codes

0 APIOK The keystrokes were successfully sent to the host RIBM


presentation space.
1 APINOTCONNECTED Your client is not connected to presentation space.
2 APIPARAMETERERROR An incorrect parameter was sent to HLLAPI.
4 APIPSBUSY Host RIBM presentation space busy, not all keystrokes
could be sent.
5 APIINHIBITED Host RIBM presentation space inhibited, not all keystrokes
could be sent.
9 APISYSERROR System error.
14 Reflection for IBM HLLAPI Reference

Remarks
You can use all keyboard combinations to represent a string sent to the RIBM presentation
space, including 3270 and 5250 function keys in ASCII mnemonics, by using an escape
character (default value is @) followed by the appropriate key code.

Each key code represents the actual key that is being sent. When sending text keystrokes, be
sure the codes are entered just as you want them to be received, including case.

If your keystroke string is longer than 255 characters (which is Send Keys), you can use one or
more calls to the Send Key (3) function. If you need to send numerous keystrokes, it is faster to
use Copy String to Presentation Space (15) or Copy String to Field (33). An efficient way to
send a large amount of data to the RIBM presentation space is to first use Copy String to
Presentation Space (15) to send the text and then finish the string with another call to Send
Key (3) to send the AID. Use the Query Field Attribute (14) function to check the status of the
receiving field.

To ensure that the keyboard is not locked, your application may call the Wait (4) function.

After the first AID key is sent, keystrokes are no longer accepted and the rest of the string is
ignored.

The following Set Session Parametes (9) values affect this function:

AUTORESET/NORESET

STRLEN/STREOT

EOT=c

ESC=c
The following HLLAPI Style Bits affect this function: Error on Bad Escape, Terminate Send
Key at AID, Error on Send Key Past AID. Search for Hllapi style bits in the Reflection for
IBM online help for more information.
Reflection for IBM HLLAPI Reference 15

HLLAPI Function

Wait (4)

Description
The Wait (4) function determines whether the RIBM presentation space can accept keystrokes
from a HLLAPI application. The Wait (4) function can be used to query the current status on the
XCLOCK and/or XSYSTEM parameter of the OIA.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 4
Data String Not applicable
Length Not applicable
PS Position Not applicable

Return Codes

0 APIOK Function was successful. The keyboard is unlocked


and ready for input.
1 APINOTCONNECTED The client application is not connected to a valid
presentation space.
4 APIPSBUSY Timed out on XXXX.
5 APIINHIBITED Keyboard is locked.
9 APISYSERROR System error.

Remarks
The Wait (4) function by itself may not be a sufficient method for determining when the host is
ready for input. To verify that the correct host panel is displayed on RIBM presentation space,
you might want to search for specific keywords or prompts, using the Search Field (30) function,
Query Cursor Location (7) function, or Search Presentation Space (6) function.

The following Set Session Parameters (9) values affect this function:
TWAIT/LWAIT/NWAIT
16 Reflection for IBM HLLAPI Reference

HLLAPI Function

Copy Presentation Space (5)

Description
The Copy Presentation Space (5) function copies the contents of the entire RIBM presentation
space into a string buffer. The size of the buffer will be the size of the RIBM presentation space
unless you decide to copy extended attributes (EABs), in which case it will be more. If you copy
EABs, the string length must be at least twice the size of the RIBM presentation space for the EAB
values to fit into the buffer.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 5
Data String The data buffer defined in the client application program should be as
large as the RIBM presentation space of the entire display buffer. If
EABs are set up to be copied, this buffer must be at least double the size
for the model.
Length Not applicable.
PS Position Not applicable.

Return Parameters
Contains the entire contents of the RIBM presentation space. The size of this parameter is
depends on the value you entered in the Data String parameter.
Return Codes

0 APIOK Function was successful. HLLAPI copied the contents to the


client application buffer.
1 APINOTCONNECTED The client application is not connected to the RIBM presen-
tation space.
4 APIPSBUSY The contents were copied to the buffer. The RIBM presen-
tation space is waiting for a response.
5 APIINHIBITED The contents were copied to the buffer; keyboard is locked.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 17

Remarks
Your client application can determine the size of the RIBM presentation space by calling
Query Sessions (10). To determine if EABs are set, can call Query Field Attribute (14).

If you need to copy only a field or a specific part of the RIBM presentation space, use Copy
Presentation Space to String (8) or Copy Field to String (34) instead.

Copy Presentation Space (5) translates the entire RIBM presentation space to ASCII code.
EABs and other characters not represented by an ASCII value are translated to blanks. To copy
EABs and ATTRIBs, set the Set Session Parameter, EAB and ATTRB parameter respectively.

The following Set Session Parameters (9) values affect this function:
ATTRB/NOATTRB

EAB/NOEAB.

XLATE/NOXLATE

The following HLLAPI Style Bits effect this function: Propogate EAB, Wait a Second, Translate
5250 Attributes to 3270, and Always Blank. Search for Hllapi style bits in the Reflection for
IBM online help for more information.
18 Reflection for IBM HLLAPI Reference

HLLAPI Function

Search Presentation Space (6)

Description
The Search Presentation Space (6) function looks for the specified string. The search can start
from a specified position on the RIBM presentation space and scan forward or backward from
that position. The method of scanning is specified by Set Session Parameters (9), SRCHALL,
SRCHFROM, SCRCHFRWD, SRCHBKWD.

This function is useful if you are looking for a particular keyword on a host screen.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 6
Data String Data string to search for, which you define in the client
program. The string is case sensitive.
Length Target buffer length.
PS Position RIBM presentation space position where to start the search
function (SRCHFRWD), or to end (SRCHBKWD). If
SRCHALL is set, this parameter is ignored.

Return Parameters
This function returns a length parameter. Length:

0 The Search function did not find the string.


>0 The returning length is the starting presentation position where the
string was found.
Reflection for IBM HLLAPI Reference 19

Return Codes

0 APIOK The function was successful (string was found).


1 APINOTCONNECTED Your client application is not connected to a host RIBM
presentation space.
2 APIPARAMETERERROR Incorrect parameter.
7 APIPOSITIONERROR Invalid RIBM presentation space position.
9 APISYSERROR System error.
24 APINOFIELD The function could not find the string.

Remarks
The Search Presentation Space (6) function searches for a specific host string, a panel, or a
message from the host on the RIBM presentation space. If your client application requires a
specific panel or message before sending data back to the host, you can use Search Presentation
Space (6) to find the string.

Use this function in conjunction with the Wait (4) function to determine whether the host
application is ready for input. First wait for input enable, then search for the correct host panel
defining a key string with Search Presentation Space (6).

This function is case-sensitive. The string you look for must be an exact match.

The following Set Session Parameters (9) values affect this function:

SRCHALL/SRCHFROM

SCRCHFRWD/SRCHBKWD
20 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query Cursor Location (7)

Description
The Query Cursor Location (7) function returns the cursor position in the currently
connected RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 7
Data String Not applicable
Length Not applicable
PS Position Not applicable

Return Parameter
Length: RIBM presentation space position of the cursor location.
Return Codes

0 APIOK The function was successful.


1 APINOTCONNECTED Your application program is not connected to an RIBM
presentation space.
9 APISYSERROR System error.

Remarks
This function is useful in conjunction with the Wait (4) function to synchronize with the host
application panel appropriate for next input.
Reflection for IBM HLLAPI Reference 21

HLLAPI Function

Copy Presentation Space to String (8)

Description
The Copy Presentation Space (8) to String function copies the RIBM presentation space to a
string in your client application.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 8
Data String Defined data string to hold the entire content of the RIBM
presentation space.

Since this function copies from the RIBM presentation space


to a string, be sure that the buffer is large enough to hold the
data specified in the length parameter.
Length Length of the target data string.
PS Position Position where the copying should begin.

Return Parameter
Data String Contents of the copied string from the RIBM presentation space.
Return Codes

0 APIOK The RIBM presentation space was copied to the pre-


allocated buffer in your client application program.
The keyboard is unlocked.
1 APINOTCONNECTED Your application program is not connected to a valid
RIBM presentation space.
2 APIPARAMETERERROR The string length specified in your application is
incorrect.
4 APIPSBUSY The content was copied. The RIBM presentation
space is waiting for a host response.
22 Reflection for IBM HLLAPI Reference

5 APIINHIBITED The content was copied. The keyboard is locked.


7 APIPOSITIONERROR Your application program calculated an invalid
RIBM presentation space position.
9 APISYSERROR System error.

Remarks
The upper left corner of the RIBM presentation space is defined as position 1 and the last
position is the maximum number of the presentation space.

The following Set Session Parameters (9) values affect this function:

ATTRB/NOATTRB

EAB/NOEAB

XLATE/NOXLATE

The following HLLAPI Style Bits effect this function: Propogate EAB, Copy PS to String
Beyond End, Wait a Second, Translate 5250 Attributes to 3270, and Always Blank. Search for
Hllapi style bits in the Reflection for IBM online help for more information.
Reflection for IBM HLLAPI Reference 23

HLLAPI Function

Set Session Parameters (9)

Description
The Set Session Parameters function lets the HLLAPI client program specify default values for
several HLLAPI functions.

The values are divided into a number of sets which affect the HLLAPI functions.

Values are in effect until one of the following events occurs:

A new call to Set Session Parameters (9) defines a new value.

The session parameters are reset using Reset System (21) function.
Prerequisites
None.
Call Parameters

Function Number 9
Data String A text string containing the session parameters. These parameter
can be contained in a list delimited by commas or spaces.
Length Length of source data string.
PS Position Not applicable.

NOATTR/ATTR
Specifies whether to translate character attributes to ASCII values or not. This parameter
affects Copy Presentation Space (5), Copy Presentation Space to String (8), and Copy Field
String (34) functions.
Parameter Description
ATTRB Keep original values in their original EBCDIC code.
NOATTRB (default) Translates non-ASCII values to blanks (20H).
24 Reflection for IBM HLLAPI Reference

EAB/NOEAB
Specifies if a copy function should include extended attributes (EABs). These functions are used
with Copy Presentation Space (5), Copy Presentation Space to String (8), Copy String to Presen-
tation Space (15), and Copy Field to String (34).
Parameter Description
EAB Data string includes extended attribute bytes (EABs), producing two
characters for each screen character. Allocatea buffer twice the size of the
RIBM presentation space.
NOEAB EABs are not included in data string. Allocate the size of the RIBM presen-
tation space (default).

STREOT/STRLEN
Determines how the length of a data string is determined.
Parameter Description
STRLEN (default) The client application copies a string with an explicit length.
STREOT Strings end with a character defined in the EOT parameter.

EOT
The EOT character is used to define a EndOfText character in a data string. This function is used
in Send Key (3), Search Presentation Space (6), Copy String to Presentation Space (15), Search
Field (30), Copy String to Field (33), Send File (90), and Receive File (91).
Parameter Description
EOT=char where char is a character that specifies the end of a data string. 0 binary
is the default value. A blank is not accepted as EOT. This parameter is
used only if the STREOT option is used.
Reflection for IBM HLLAPI Reference 25

XLATE/NOXLATE
Specifies if EABs are translated to CGA format or not.
Parameter Description
XLATE EABs are translated to CGA format (default).
NOXLATE Skips EAB translation.

CONLOG/CONPHYS
These parameters are ignored.

ESC Parameter
Specifies the Esc character. This parameter is used by Send Key (3) and Get Key (51).
Parameter Description
ESC=char Specifies the escape character for keystroke mnemonics (@ is the
default). Blank is not a valid escape value.

AUTORESET/RESET
This parameter is used by Send Key (3) and Get Key (51).
Parameter Description
AUTORESET (default) Automatically sends Reset with strings with Send Key (3)
function to unlock the input inhibited condition that might exist.
NORESET Does not send a Reset in a data string.

SEARCHALL/SRCHFROM
Specifies how HLLAPI should search the RIBM presentation space. These parameters are used
with Search Presentation Space (6) and Search Field (30).
Parameter Description
SRCHALL Searches the entire RIBM presentation space or field (default).
SRCHFROM Searches from a specified beginning location of the RIBM presentation
space or field.
26 Reflection for IBM HLLAPI Reference

SEARCHFRWD/SRCHBKWD
Parameter Description
SCRCHFRWD Searches forward through the RIBM presentation space (default).
SRCHBKWD Searches backward through the RIBM presentation space.

TRON/TROFF
Specifies debug tracing. A file will be created in the TEMP directory (or Windows directory if
the TEMP environment variable isnt set). The name of the file is Hll*.tmp, where * is a
random
hex number between 0 and FFFFF. The file will be appended for as long as that instance of the
HLLAPI DLL is loaded in memory. Subsequent instances will create new files.
Trace Parameter
Parameter Description
TRON Turns trace on.
TROFF (default) Turns trace off.

Wait Parameter
Specifies the characteristics of a wait period.
Parameter Description
TWAIT (default) For Wait (4), waits up to 60 seconds before timing out on
XCLOCK or XSYSTEM. For Get Key (51) TWAIT waits until a key is
in the buffer (normal or AID key based on Start Keystroke Intercept
(50) option, D or L ), and then returns control to the client HLLAPI
program.
LWAIT For Wait (4), waits until XCLOCK/XSYSTEM clears on OIA. For Get
Key (51), LWAIT does not return control to your HLLAPI program
until it has intercepted a keystroke (normal or AID key based on Start
Keystroke Intercept (50) option, D or L).
NWAIT No waiting period. For Wait (4), checks status and returns immediately.
For Get Key (51) immediately, keystroke not available.
Reflection for IBM HLLAPI Reference 27

FPAUSE/IPAUSE
Specifies type of pause. This parameter is used by the Pause (18) function.
Parameter Description
FPAUSE Full pause. The HLLAPI client program can set the duration of the
pause in the Pause (18) function (default).
IPAUSE Interruptible pause; Start Host Notification (23) or any host system
event will end a pause.

NOQUIET/QUIET
Specifies whether the Send File (90) or Receive File (91) functions will send messages to the
RIBM presentation space and display them to the operator.
Parameter Description
NOQUIET Displays messages.
QUIET Does not display messages.

TIMEOUT
Specifies the number of 30-second cycles HLLAPI waits before terminating the file transfer with
Ctrl+Break. This parameter is used with the Send File (90) or Receive File (91) functions.
Parameter Description
TIMEOUT=0 A Ctrl+Break is issued after 30 seconds: Blanks are not allowed.
TIMEOUT=char Specifies the number of 30-second cycles to wait until HLLAPI issues a
Ctrl + Break and terminates the file transfer. c=character which defines
how many 30 second cycles are acceptable before a Ctrl+Break is issued.
No blanks are allowed

Character Minutes Seconds

1 0.5 30

2 1.0 60

3 1.5 90

4 2.0 120

5 2.5 150
28 Reflection for IBM HLLAPI Reference

Character Minutes Seconds

6 3.0 180

7 3.5 220

8 4.0 240

9 4.5 270

J 5.0 300

K 5.5 330

L 6.0 360

M 6.5 390

N 7.0 420

RESUME/NORESUME
Specifies how Connect Presentation Space (1) affects a DOS session.
Parameter Description
RESUME Resumes a DOS session while the host session is active.
NORESUME Suspends DOS session while the host session is active.

BLANK/NOBLANK
Specifies how Copy Presentation Space (5) and Copy Presentation Space to String affects
unknown values NOATTRIB and NOEAB are specified.
Parameter Description
BLANK Converts unknown values to X00.
NOBLANK Converts unknown values to X20.
Reflection for IBM HLLAPI Reference 29

NEWOIA/OLDOIA
Specifies in which format the Copy OIA (13) function returns its data.
Parameter Description
OLDOIA Data OIA is returned in 3270 PC format. The 5250 OIA image is
always returned in ASCII.
NEWOIA Data OIA is returned in ASCII format.

NEWRET / OLDRET
Specifies how the Query Cursor Location (7) function returns cursor position data.
Parameter Description
NEWRET Query Cursor Location (7) returns the cursor position in the Length
or Location parameter.
OLDRET Query Cursor Location (7) returns the cursor position in the Return
Code parameter.

Return Parameter

Length: Number of valid session parameters that were set. Invalid session parameters
will not return.

Return Codes

0 APIOK Successful.
2 APIPARAMETERERROR There was one or more unrecognized parameter value;
all recognized values accepted.
9 APISYSERROR System error.
30 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query Sessions (10)

Description
The Query Sessions function returns a 12 byte data string for each started RIBM presentation
space. The data string contains information about RIBM presentation space names and size of
RIBM presentation space. It also returns a data length parameter which holds the number of
active RIBM presentation spaces.
Prerequisites
None.
Call Parameters

Function Number 10
Data String Data string for session parameters.
Length 12 bytes * the number of started host RIBM presen-
tation spaces. Max size is 12 * 16 (192).
PS Position Not applicable.

Return Parameters
Length The number of started host RIBM presentation spaces.

Each 12-byte string contains

1 RIBM presentation space short name.


2-9 RIBM presentation space long name.

10 H = host.

11-12 RIBM presentation space size. For example, an IBM model 2 is 1920.
Return Codes

0 APIOK Successful
2 APIPARAMETERERROR Invalid string length
9 APISYSERROR System error
Reflection for IBM HLLAPI Reference 31

HLLAPI Function

Reserve (11)

Description
The Reserve function blocks an operator from entering any information on the RIBM presen-
tation space via the keyboard. You should use this function if you need total control of the
RIBM presentation space and need to prevent other input.
Prerequisite
Connect Presentation Space (1).
Call Parameters

Function Number 11
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 APIOK The Reserve function was successful.


1 APINOTCONNECTED Your client application is not connected to an
RIBM presentation space.
9 APISYSERROR System error.

Remarks
The Reserve (11) function is very useful if your application is sending a series of keystrokes to a
host panel and you want to prevent the users from accessing the RIBM presentation space
until the transactions are completed.

Your HLLAPI application needs to unlock the RIBM presentation space with Release (12),
Disconnect Presentation Space (2), or Reset System (21) functions.
32 Reflection for IBM HLLAPI Reference

HLLAPI Function

Release (12)

Description
The Release function unlocks a RIBM presentation space that was locked using the Reserve (11)
function.
Prerequisite
Connect Presentation Space (1) and Reserve (11)
Call Parameters

Function Number 12
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 APIOK The Release function was successful.


1 APINOTCONNECTED Your client application is not connected to
an RIBM presentation space.
9 APISYSERROR System error.

Remarks
RIBM presentation space unlock also occurs automatically when the application program
disconnects from the reserved session with Disconnect Presentation Space (2), connects to
another session with Connect Presentation Space (2), or calls Reset System (21).
Reflection for IBM HLLAPI Reference 33

HLLAPI Function

Copy OIA (13)

Description
The Copy Operator Information Area function returns the contents of the operator information
area (OIA) from the currently connected RIBM presentation space. A 103-byte string returns the
data to your client HLLAPI application. The interpretation of the string is different for a 3270
and a 5250 string.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 13
Data String A 103 byte long data string, pre-allocated in your
application program.
Length 103 bytes.
PS Position Not applicable.

Return Parameters

Data String: Data string containing the contents of the identified OIA.
The OIA data string contains the following information:

Byte:

1 OIA Format Byte. This byte is always 1 for 3270, and 9 for 5250.
2 - 81 OIA Image Groups. These bytes contain hexadecimal codes of the
OIA image symbols.
82 - 103 The OIA group indicators. Can be an ASCII character string trans-
latable into graphics characters.
34 Reflection for IBM HLLAPI Reference

OIA Image Symbols for 3270 Sessions

3270 OIA Group Indicators


Group 1: Online and screen ownership
1 byte (Data String position 82) applies to Data String position 2

Bits 0-1 Reserved


Bit 2 SSCP-LU session owns screen
Bit 3 LU-LU session owns screen
Bit 4 Online and not owned
Bit 5 Subsystem ready
Bits 6-7 Reserved
Reflection for IBM HLLAPI Reference 35

Group 2: Character selection


1 byte Data String position 83

Bit 0 Reserved
Bit 1 APL
Bit 2 Kana
Bit 3 Alpha
Bits 4-7 Reserved
Group 3: Shift state
1 byte Data String position 84

Bit 0 Upper shift


Bit 1 Numeric shift
Bits 2-7 Reserved
Group 4: Program Symbol Support group 1
1 byte Data String position 85 not used (reserved)
Group 5: Highlight group 1
1 byte Data String position 86

Bit 0 User-selectable
Bit 1 Field inherit
Bits 2-7 Reserved
Group 6: Color group 1
1 byte Data String position 87

Bit 0 User-selectable
Bit 1 Field inherit
Bits 2-7 Reserved
Group 7: Insert
1 byte Data String position 88

Bit 0 Insert mode


Bit 1-7 Reserved
36 Reflection for IBM HLLAPI Reference

Group 8: Input inhibited


5 bytes Data String positions 89-93
Byte 1 (Data String position 89)
Bit 0Non-resettable machine check
Bit 1Reserved
Bit 2Machine check
Bit 3Communications check
Bit 4Program check
Bit 5Reserved
Bit 6Device not working
Bit 7Reserved
Byte 2 (Data String position 90)
Bit 0OIA time
Bit 1Terminal wait
Bit 2Reserved
Bit 3Minus function
Bit 4Too much entered
Bits 5-7Reserved
Byte 3 (Data String position 91)
Bit 0 Reserved
Bit 1 User-unauthorized
Bit 2 User-unauthorized, minus function
Bit 3 Invalid dead key combination
Bit 4 Wrong place
Bits 5-7 Reserved
Byte 4 (Data String position 92)
Bits 0-1Reserved
Bit 2System wait
Bits 3-7Reserved
Byte 5 (Data String position 93)
Bits 0-7Reserved
Reflection for IBM HLLAPI Reference 37

Group 9: Program Symbol Support group 2


1 byte (Data String position 94) not used (reserved)
Group 10: Highlight group 2
1 byte (Data String position 95)

Bit 0 Selected
Bits 1-7 Reserved
Group 11: Color group 2
1 byte (Data String position 96)

Bit 0 Selected
Bits 1-7 Reserved
Group 12: Communication error
1 byte Data String position 97

Bit 0 Communications error


Bit 1-7 Reserved
Group 13: Printer status
1 byte (Data String position 98)

Bit 0 Reserved
Bit 1 Printer malfunction
Bit 2 Printer printing
Bit 3 Printer assignment
Bits 4-7 Reserved
Group 14: Graphics
1 byte Data String position 99 not used (reserved)
Group 15: Not used
1 byte Data String position 100 not used (reserved)
Group 16: Autokey play/record status
1 byte Data String position 101 not used (reserved)
Group 17: Autokey abort/pause status
1 byte Data String position 102 not used (reserved)
38 Reflection for IBM HLLAPI Reference

Group 18: Enlarge state


1 byte Data String position 103 not used (reserved)
OIA Image Symbols for 5250 Sessions

OIA Group Indicator Meanings for 5250 Sessions


Group 1: Online and screen ownership
1 byte Data String position 82

Bits 0-2 Reserved


Bit 3 System available
Bit 4 Reserved
Bit 5 Subsystem ready
Bits 6-7 Reserved
Reflection for IBM HLLAPI Reference 39

Group 2: Character selection


1 byte Data String position 83

Bits 0-4 Reserved


Bit 5 Diacritic mode
Bit 6-7 Reserved
Group 3: Shift state
1 byte Data String position 84

Bits 0 Reserved
Bit 1 Keyboard Shift
Bits 2-7 Reserved
Group 4: Program System Support group 1
1 byte Data String position 85 not used (reserved)
Group 5: Highlight group 1
1 byte Data String position 86 not used (reserved)
Group 6: Color group 1
1 byte Data String position 87 not used (reserved)
Group 7: Insert
1 byte Data String position 88

Bit 0 Insert mode


Bits 1-7 Reserved
Group 8: Input inhibited
5 bytes Data String positions 89-93
Byte 1 Data String position 89
Bit 0-7 Reserved
Byte 2 Data String position 90
Bit 0-7 Reserved
40 Reflection for IBM HLLAPI Reference

Byte 3 Data String position 91


Bits 0-4 Reserved
Bit 5 User input error (II)
Bits 3-7 Reserved
Byte 4 Data String position 92
Bits 0-1 Reserved
Bit 2 System wait
Bits 3-7 Reserved
Byte 5 Data String position 93
Bits 0-7 Reserved
Bit 5 User input error (II)
Bits 3-7 Reserved
Group 9: Program Symbol Support group 2
1 byte (Data String position 94) not used (reserved)
Group 10: Highlight group 2
1 byte (Data String position 95) not used (reserved)
Group 11: Color group 2
1 byte (Data String position 96) not used (reserved)
Group 12: Communication error reminder (97)
1 byte (Data String position 97)

Bit 0-6 Reserved


Bit 7 Message Waiting (MW)
Group 13: Printer status
1 byte Data String position 98 not used (reserved)
Reflection for IBM HLLAPI Reference 41

Group 14: Graphics


1 byte Data String position 99 not used (reserved)
Group 15: Not used
1 byte Data String position 100 not used (reserved)
Group 16: Autokey play/record status
1 byte Data String position 101 not used (reserved)
Group 17: Autokey abort/pause status
1 byte Data String position 102 not used (reserved)
Group 18: Enlarge state
1 byte Data String position 103 not used (reserved)
Return Codes

0 APIOK OIA copying is successful. RIBM presentation space is


unlocked for input.
1 APINOTCONNECTED The HLLAPI application is not connected to a valid RIBM
presentation space.
2 APIPARAMETERERROR The HLLAPI application passed an invalid string length.
The OIA could not be copied.
4 APIPSBUSY The OIA was copied, but RIBM presentation space is busy.
5 APIINHIBITED The OIA was copied, RIBM presentation space is locked.
9 APISYSERROR System error.

Remarks
The following HLLAPI Style Bits affect this function: Input Inhibited Position, Wait a Second.
Search for Hllapi style bits in the Reflection for IBM online help for more information.
42 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query Field Attribute (14)

Description
The Query Field Attribute function returns a field attribute byte for a specific RIBM
presentation space position.

The field attribute is returned in the parameter as an integer. This value is converted to
a binary value.
Prerequisite
Connect Presentation Space (1)
Call Parameters
Function Number14

Data String Not applicable.

Length Not applicable.

PS Position RIBM presentation space position.


Return Parameters
Length:

0 RIBM presentation space is unformatted. No attribute can be returned.


>0 If value is greater than zero, it returns the value of the field attribute on
RIBM presentation space.

Bit Position Meaning

0-1 Both =1, field attribute Byte


2 Unprotected/Protected
0 = Unprotected data field
1 = Protected field
3 A/N
0 = Alphanumeric data
1 = Numeric data only
Reflection for IBM HLLAPI Reference 43

Bit Position Meaning

4-5 I/SPD
00 = Normal intensity, pen not detectable
01 = Normal intensity, pen detectable
10 = High intensity, pen detectable
11 = Non-Display, pen not detectable
6 Reserved
7 MDT
0 = Field has not been modified
1 = Field has been modified

Return Codes

0 APIOK The Query Field Attribute was successful.


1 APINOTCONNECTED The HLLAPI application is not connected to the
RIBM presentation space.
7 APIPOSITIONERROR RIBM presentation space position is invalid.

Remarks
This function determines the RIBM presentation space target field when you use the
following functions:

Copy String To Field (33)

Copy String To Presentation Space (15)

Find Field Length (32)

Find Field Position (31)


Send Key (3)
44 Reflection for IBM HLLAPI Reference

HLLAPI Function

Copy String to Presentation Space (15)

Description
The Copy String to Presentation Space (15) function copies an ASCII data string to a defined
position on the RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 15
Data String A string of ASCII characters you want to copy into an unformatted
position on RIBM presentation space.
Length Contains the total length of the string to copy, including EABs, if
the EAB parameter is selected. This parameter is ignored if you have
selected the STREOT parameter using Set Session Parameters (9).
PS Position RIBM presentation space position where copying begins.

Return Codes

0 APIOK The Copy String to Presentation space (15) function was


successful. The string was copied.
1 APINOTCONNECTED Copy not configured or the client application does not have
a connection.
2 APIPARAMETERERROR Parameter error.
5 APIINHIBITED The RIBM presentation space is prohibited, field is
protected, or non-ASCII data was sent to the RIBM presen-
tation space.
6 APITRUNCATED The function was successful, the string was copied, but data
is truncated at end of screen, or end of field.
7 APIPOSITIONERROR The RIBM presentation space position is invalid. Check the
size of the RIBM presentation space.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 45

Remarks
The data string must be the same size or smaller than the size of the RIBM presentation space
buffer size or the size of the target area.

Non-ASCII characters in the data string are translated into blanks in the RIBM presentation
space.

If EABs are set, the input string should contain the appropriate EABs following each ASCII
character.

This function is also affected by the STRLEN/STREOT and EOT option, defined in Set Session
Parameters (9). To send AID keys to RIBM presentation space, use the Send Key (3) function.
For example, the most efficient way to send a host command to the host session is to send the
ASCII string with the Copy String to Presentation Space (15) function and then send the Enter
AID key with the Send Key (3) function.
The cursor location will not be updated with the Copy String to Presentation Space (15)
function. To copy to the current cursor position, use the Query Cursor Location (7), and place
the returning parameter value in the presentation space position parameter when you call this
function.

The following HLLAPI Style Bits effect this function: Modify Protected Field, Transmit
Modified Protected Fields, Dont Wrap at presentation space End. Search for Hllapi style
bits in the Reflection for IBM online help for more information.
46 Reflection for IBM HLLAPI Reference

HLLAPI Function

Pause (18)

Description
The Pause (18) function is used to add a pause to a host session sequence. The function halts for
a specified amount of time, or until a host event satisfies the pause.
Prerequisites
A Start Host Notification (23) function call is required if the IPAUSE parameter is selected using
Set Session Parameters (9).
Call Parameters

Function Number 18
Data String Not applicable.
Length Sets the duration of the pause. This parameter must be an
integer between 0 and 65535. The pause is set in half-second
increments. For example, 1 = 0.5 seconds, 60 = 30 seconds,
120 = 1 minute (60 seconds), etc.
PS Position Not applicable.

Return Codes

0 APIOK Pause duration has expired.


9 APISYSERROR System error.
26 APIPSCHANGED RIBM presentation space or OIA has been updated.
Use Query Host Update (24) for more information.
Reflection for IBM HLLAPI Reference 47

Remarks
An event happens when either the RIBM presentation space, or OIA is updated during a
session. If you need to terminate the pause for this type of event, select the IPAUSE parameter
in Set Session Parameters (9). Only then will the Pause function terminate.

If your client application is not connected to a RIBM presentation space the pause will wait the
full duration, disregarding the pause parameter. If the IPAUSE parameter is selected using Set
Session Parameters (9), the pause queue needs to clear before next function call. To reset the
pause queue prior to the next Pause (18) function call, you must call the Query Host Update
(24) function.

The Pause (18) function is not an efficient method of pausing if you need to wait for long
periods of time. Do not use the Pause (18) function if your application needs to pause longer
than 20 minutes. The Pause (18) function is not an exact timekeeper, and should not be used
for applications that require precise timing.

The following Set Session Parameters (9) values affect this function:

FPAUSE/IPAUSE
48 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query System (20)

Description
The Query System (20) function lets your HLLAPI application determine settings and other
values related to the system. The function returns a 35-byte long string with HLLAPI-related
information such as version number, level number, date, etc.
Prerequisites
None.
Call Parameters

Function Number 20
Data String A 35-byte data string. The return parameter contains the
system information.
Length Not applicable (35 is implied).
PS Position Not applicable.

Return Parameter
This function returns a 35 byte long string with system information.
Data String
Bytes

1 HLLAPI version number.


2-3 HLLAPI level number.
4-9 HLLAPI version date (mmddyy).
10-12 Not applicable.
13 Hardware Base (always U).
14-35 Not applicable.
Reflection for IBM HLLAPI Reference 49

Return Codes

0 APIOK The Query System function was successful.


1 APINOTCONNECTED HLLAPI not connected to RIBM presentation space.
2 APIPARAMETERERROR Parameter error, Invalid string length. You must allocate a
35-byte string to receive the returning data string parameter.
9 APISYSERROR System error.

Remarks
You must allocate a 35-byte string to receive the returning data string parameter.

HLLAPI Function

Reset System (21)

Description
The Reset System (21) function reinitializes the HLLAPI to its starting state. This function can
also be used to ensure that HLLAPI is loaded.

You can use this function when you start or terminate your HLLAPI program.
Prerequisites
None.
Call Parameters

Function Number 21
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 APIOK The Reset function was successful.


1 APINOTCONNECTED HLLAPI not loaded. This return code is useful to insure that
HLLAPI is loaded.
9 APISYSERROR System errors.
50 Reflection for IBM HLLAPI Reference

Remarks
The system resets the following:

Reinitializes HLLAPI to the starting state.

Default values are restored in Set Session Parameters (9).

Unlocks keyboard and stops keyboard intercept, if started.


Stops host notification, if started.

Stops close intercept, if started.

Disconnects the client application from connected RIBM presentation space.

Releases host sessions.

Cancels error messages.

If you need to restore all values, call this function when you are exiting your HLLAPI application.
To restore selected session values, use the Set Session Parameters (9) instead.

In the beginning of an application you can restore values with Reset (21) and ensure that
HLLAPI is loaded. If HLLAPI is not loaded, a return code 1 APINOTCONNECTED will be
returned.

Reset System (21) should be used very sparingly, i.e. during startup only; use Set Session Param-
eters (9) instead to change session parameters.
Reflection for IBM HLLAPI Reference 51

HLLAPI Function

Query Session Status (22)

Description
The Query Session Status (22) function returns information about a RIBM presentation space.
The function returns the status information in an 18-byte data string.

The following information is included in the return parameter of Query Session Status (22).

RIBM presentation space names

Session type

EAB and PSS information

Session usage

RIBM presentation space row/column information

Host code number


Prerequisites
None.
Call Parameters

Function Number 22
Data String 18 bytes. The first byte must be either:
a letter A-Z, which indicates the RIBM presentation space
short name.
a (space) which indicates the currently connected
RIBM presentation space.
Length 18 bytes.
PS Position Not applicable.
52 Reflection for IBM HLLAPI Reference

Return Parameters
Data String:

1 RIBM presentation space short name.


2-9 RIBM presentation space long name.
10 RIBM presentation space type information.
How this is implemented.
D = 3270 Host.
F = 5250 Host.
11 RIBM presentation space Characteristics.
Bit 0: 0 = No EABs
1 = EABs are on
1-7: Not used
12 - 13 Binary value. Number of RIBM presentation space rows.
14 - 15 Binary value. Number of RIBM presentation space columns.
16 - 18 Not applicable.
Return Codes

0 APIOK Query Session Status function was successful.


1APINOTCONNECTED Invalid RIBM presentation space short name
2 APIPARAMETERERROR Invalid string parameter length. Length must be set to 18.
9 APISYSERROR System error.

Remarks
The values for Rows and Columns returned in byte 12-15 correspond to the RIBM presen-
tation space buffer size depending on the model.
Reflection for IBM HLLAPI Reference 53

HLLAPI Function

Start Host Notification (23)

Description
The Start Host Notification (23) function starts monitoring the RIBM presentation space or
operator information area for updates. Following this call, your application must call the
Query Host Update (24) function to check when the host updated the RIBM presentation
space or OIA.
Prerequisites
None.
Call Parameters

Function Number 23
Data String A six-byte long string.
1 RIBM presentation space short name, or blank or null
(request against the currently connected RIBM
presentation space).
2 One of the following characters:

B = Both. Notification of OIA and presentation space


updates.

O = Notification of any OIA updates.

3-6 P = Notification of any RIBM presentation space


updates.

Ignored by HLLAPI. No error is caused if the


program has data in these positions.
Length 6
PS Position Not applicable.
54 Reflection for IBM HLLAPI Reference

Return Codes
0 APIOK The Start Host function was successful.

1 APINOTCONNECTED Invalid RIBM presentation space ID.

2 APIPARAMETERERROR Invalid parameters.

9 APISYSERROR System error.


Remarks
The Copy OIA (13) function is a superior way of ensuring that the host has completed processing
and that the RIBM presentation space is ready for input. To be sure the correct host panel is
displayed, call Search Presentation Space (6) and search for a keyword within the panel.

HLLAPI Function

Query Host Update (24)

Description
The Query Host Update (24) function allows your application to determine if the host has
updated the RIBM presentation space, or operator information area (OIA) since:

Start Host Notification (23)

Previous Query Host Update (24) function was called.

The queried RIBM presentation space must be specified in the data string, but your EHLLPI
application program does not need to be connected to current the RIBM presentation space for
updates.
Prerequisites
Your application must call the Start Host Notification (23) function before calling this function.
Call Parameters

Function Number 24
Data String One character A-Z short name for the RIBM presen-
tation space. A space indicates a request for updates to
the requested RIBM presentation space.
Length Not applicable (1 is implied).
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 55

Return Codes

0 APIOK No updates have been made since last function call.


1 APIANOTCONNECTED Invalid RIBM presentation space ID.
8 APINOTAVAILABLE Your application needs to call Start Host Notification (23).
9 APISYSERROR System error
21 APIOIAUPDATE The OIA was updated.
22 APIPSUPDATE The RIBM presentation space was updated.
23 APIBOTHUPDATE Both OIA and RIBM presentation space were updated.

Remarks
To disable the Query Host Update (24) function, and stop monitoring updates, you must
call the Stop Host Notification (25) function.

The Stop Host Notification (25) function ends the Query Host Update function (24).

The following HLLAPI Style Bits effect this function: Query Host Update Protocol,
Wait a Second. Search for Hllapi style bits in the Reflection for IBM online help for
more information.
56 Reflection for IBM HLLAPI Reference

HLLAPI Function

Stop Host Notification (25)

Description
The Stop Host Notification (25) function disables the capability of the Query Host Update
(24) function to determine if the host RIBM presentation space or OIA has been updated.
This function can also be used to stop host events from affecting the Pause function.
Prerequisites
Start Host Notification (23)
Call Parameters

Function Number 25
Data String Short name of the RIBM presentation space or blank or null
indicating a request for the current RIBM presentation space.
Length Not applicable (1 is implied).
PS Position Not applicable.

Return Codes

0 APIOK Stop Host Notification was successful.


1 APIANOTCONNECTED Invalid RIBM presentation space short name.
8 APINOTAVAILABLE No Start Notification was issued.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 57

HLLAPI Function

Search Field (30)

Description
The Search Field (30) function searches for a text string in protected or unprotected fields of
the RIBM presentation space. When the specified text string is found, the function returns the
RIBM presentation space position.

This function is case-sensitive and requires an exact match of the text string parameter and the
RIBM presentation space content.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 30
Data String Text string to search presentation. End the string with EOT if
the client uses STREOT. See Set Session Parameters (9).
Length Specifies the length of the string you are searching. Not appli-
cable if EOT is used to end the string.
PS Position Specifies the beginning RIBM presentation space position to
search from. If SRCHFROM is set, it also specifies the position
within the field.

Return Parameters
Length:

0 String was not found. The returning length is set to 0.


>0 If the returning length is greater (>) than 0, the returning length is the
starting RIBM presentation space position where the string was found.
58 Reflection for IBM HLLAPI Reference

Return Codes

0 APIOK The Search Field (30) function was successful.


1 APINOTCONNECTED Invalid RIBM presentation space position.
2 APIPARAMETERERROR Parameter error. String length set to zero or an EOT
character was not found in the calling data string.
7 APIPOSITIONERROR Invalid RIBM presentation space position.
9 APISYSERROR System error.
24 APINOFIELD String not found.

Remarks
The following Set Session Parameters (9) values affect this function:
Search Parameters
SRCHALL/SRCHFROM

SCRCHFRWD/SRCHBKWD
Reflection for IBM HLLAPI Reference 59

HLLAPI Function

Find Field Position (31)

Description
The Find Field Position (31) function returns the position of a target field at the currently
connected RIBM presentation space. This function is useful for searching for either protected
or unprotected fields in a field formatted RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 31
Data String Defines the field type.
[space] [space] This field ( )
T[space] This field (T )
N[space] Next field (N ) either protected or unprotected
P[space] Previous field (P ) either protected or unprotected
NP Next protected field (NP)
NU Next unprotected field (NU)
PP Previous protected field (PP)
PU Previous unprotected field (PU)
Length Not applicable (2 is implied)
PS Position Contains the RIBM presentation space position in a
field where the function starts the search.
60 Reflection for IBM HLLAPI Reference

Return Parameters
Length:

0 If return code 28: No such field found. If return code 24: unformatted host
RIBM presentation space.
>0 The returning length is the starting RIBM presentation space position where
the field was found, defined as the first position after the attribute byte.

Return Codes

0 APIOK The Find Field Position (31) function was successful


1 APINOTCONNECTED Not connected to an RIBM presentation space
2 APIPARAMETERERROR Parameter error
7 APIPOSITIONERROR Invalid RIBM presentation space position
9 APISYSERROR System error
24 APINOFIELD No such field or RIBM presentation space not formatted
28 APIZEROLENFIELD Field length = 0

Remarks
Query Field Attribute (14) returns the field attribute bytes value, and it can also detect an
unformatted RIBM presentation space. If the return parameter length is 0, the RIBM presen-
tation space is unformatted.
Reflection for IBM HLLAPI Reference 61

HLLAPI Function

Find Field Length (32)

Description
The Find Field Length (32) function searches the RIBM presentation space for a protected or
unprotected field and returns the field length.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 32
Data String Specifies which field you want to search.
[space] [space] This field ( )
T[space] This field (T )
N[space] Next field (N ) either protected or unprotected
P[space] Previous field (P ) either protected or unprotected
NP Next protected field (NP)
NU Next unprotected field (NU)
PP Previous protected field (PP)
PU Previous unprotected field (PU)
Length Not applicable (2 is implied).
PS Position Contains the presentation space position where you want to
start the search.
62 Reflection for IBM HLLAPI Reference

Return Parameters
Length:

0 If return code 28: No such field found. If return code 24: unformatted
host RIBM presentation space.
>0 Length of the field.

Return Codes

0 APIOK The Find Field Length (32) function was successful.


1 APINOTCONNECTED Not connected to an RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
7 APIPOSITIONERROR Invalid RIBM presentation space position.
9 APISYSERROR System error.
24 APINOFIELD No such field.
28 APIZEROLENFIELD Field length = 0

Remarks
The Find Length (32) function returns the number of characters in the requested field in the
RIBM presentation space. The characters are calculated from the start of the target field
including the character before the next attribute byte.

The Find Length (32) function does not wrap, so if a field extends from the end to the
beginning of the RIBM presentation space, this function returns the length from the field
origin to the end of the RIBM presentation space.

If the field attribute is at the end of the RIBM presentation space, the field is assumed to have a
length of zero.

If two field attributes are positioned together, the field length in between them is assumed to
be zero.
Query Field Attribute (14) is useful for finding the current modified or protected field.
Reflection for IBM HLLAPI Reference 63

HLLAPI Function

Copy String to Field (33)

Description
The Copy String to Field (33) function copies a string of characters, defined in your client appli-
cation, into a specific unprotected field in the RIBM presentation space. It can only be used in a
field-formatted RIBM presentation space with unprotected fields.
Prerequisite
Connect Presentation Space (1).
Call Parameters

Function Number 33
Data String String of data in your application program you want to copy to
the RIBM presentation space. End string with EOT if STREOT is
specified. See Set Session Parameters (9).
Length Length of data. Applicable only if STRLEN is used.
PS Position Position on RIBM presentation space where the string will be copied.
The function transfers the string and places it in the beginning of the
unprotected field.

Return Codes

0 APIOK The Copy String to Field (33) was successful, the string was
copied.
1 APINOTCONNECTED Not connected to RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
5 APIINHIBITED The RIBM presentation space field was protected or locked
or non-ASCII characters was sent to the field.
6 APITRUNCATED Copied; data truncated. The field may be shorter than the
copied string.
7 APIPOSITIONERROR Invalid RIBM presentation space position.
9 APISYSERROR System error.
24 APINOFIELD Unformatted host RIBM presentation space.
64 Reflection for IBM HLLAPI Reference

Remarks
The copy operation ends when one of the following conditions is met:

End of source string is reached (as defined in the Length parameter)

End of field (EOF) in RIBM presentation space is reached

End of RIBM presentation space is reached


EOT is detected, if selected

Note that the Copy String to Field (33) function cannot copy non-ASCII characters or AID
keys to a field. Your application must use the Send Key (3) function to supply AID keys to a
RIBM presentation space.

The following HLLAPI Style Bits effect this function: Modify Protected Field, Transmit
Modified Protected Fields, Dont Wrap at PS End. Search for Hllapi style bits in the
Reflection for IBM online help for more information.
Reflection for IBM HLLAPI Reference 65

HLLAPI Function

Copy Field to String (34)

Description
The Copy Field to String (34) function copies ASCII characters from a protected or unprotected
field in the RIBM presentation space to a string defined in your application. The RIBM presen-
tation space must be field-formatted.
Prerequisite
Connect Presentation Space (1)
Call Parameters

Function Number 34
Data String String to which the program copies the contents of the field.
Length Length of the field. If the field contains EABs, then the length must
be twice the length of the field.
PS Position Any position within the field of the RIBM presentation space. The
copying will always start from the beginning of the field.

Return Parameter
Data String:
This string contains the data that was copied from the field. The first byte of the returned string
contains the start byte of the field in the RIBM presentation space. The length of this string is
either the number of bytes in the specified field, or the number of bytes specified in the Length
parameter. If the Length parameter is shorter than the actual string, the function returns an error
code (6), and the string is truncated.
Return Codes

0 APIOK The Copy Field to String (34) function was successful.


1 APINOTCONNECTED Not connected to an RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
6 APITRUNCATED Data string and field lengths are not equal size. Data is
truncated.
66 Reflection for IBM HLLAPI Reference

7 APIPOSITIONERROR Invalid RIBM presentation space.


9 APISYSERROR System error.
24 APINOFIELD Unformatted RIBM presentation space.

Remarks
You can specify a presentation space Position anywhere within the field; the copy operation
starts from the beginning of a protected or unprotected field. If your application specifies a
position in the middle of a field the function copies the string from the beginning of that field.

Copy Field To String (34) transfers the string from the beginning of the field to the length
specified in the Length parameter.

Use Find Field Position (31) to find the field's position on the RIBM presentation space and
Find Field Length (32) to calculate the fields length, and then use the return parameters for
these functions in the Data String and Length parameters.

The copy operation ends when one of the following conditions is met:

End of field is reached

End of target buffer length is reached


End of RIBM presentation space is reached

This function is affected by the Set Session Parameters (9) functions:

ATTRB/NOATTRB

EAB/NOEAB

XLATE/NOXLATE

The Copy Field to String (34) function usually translates characters into ASCII, attributes are
translated to blanks.
The following HLLAPI style bits affect this function: Propogate EAB, Wait a Second, Translate
5250 Attributes to 3270, and Always Blank. Search for Hllapi style bits in the Reflection for
IBM online help for more information.
Reflection for IBM HLLAPI Reference 67

HLLAPI Function

Display Cursor (37)

Description
The Display Cursor (37) function displays the cursor at a specified location in the RIBM
presentation space.
Prerequisite
None.
Call Parameters

Function Number 37
Data String Presentation space short name.
Length Not applicable.
PS Position Desired cursor position in the RIBM presentation space.

Return Codes

0 APIOK The Display Cursor (37) function displayed the cursor


successfully at the specified position.
1 APINOTCONNECTED Not connected to an RIBM presentation space.
4 APIPSBUSY RIBM presentation space is busy.
7 APIPOSITIONERROR Invalid RIBM presentation space position. The cursor
location was outside the boundaries of the RIBM
presentation space.
9 APISYSERROR System error.

Remarks
The difference between Set Cursor (40) and Display Cursor (37) is that Display Cursor (37)
also takes a data string parameter when a short name is specified, and it does not have
Connect Presentation Space (1) as a prerequisite. Set Cursor (40) does not need the short
name, but you must call Connect Presentation Space (1) to execute it.
68 Reflection for IBM HLLAPI Reference

HLLAPI Function

Set Cursor (40)

Description
The Set Cursor (40) function puts the cursor at a desired location in the RIBM presentation
space.
Prerequisite
None.
Call Parameters

Function Number 40
Data String Not applicable.
Length Not applicable.
PS Position Desired cursor position in the RIBM presentation space.

Return Codes

0 APIOK The Set Cursor (40) function positioned the cursor


successfully at the specified position.
1 APINOTCONNECTED Not connected to a RIBM presentation space.
4 APIPSBUSY RIBM presentation space is busy.
7 APIPOSITIONERROR Invalid RIBM presentation space position. The cursor
location was outside the boundaries of the RIBM
presentation space.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 69

HLLAPI Function

Start Close Intercept (41)

Description
The Start Close Intercept (41) function intercepts a close request, when the user selects the
close option from the emulator.

To disable this function you must call Stop Close Intercept.


Prerequisite
None.
Call Parameters
Function Number 41

Data String

a letter A-Z, which indicates the RIBM presentation space short name.

a (space) which indicates the currently connected RIBM presentation space.

Length 1

PS Position Not applicable.


Return Codes

0 APIOK The Start Close Intercept (41) function was successful.


1 APINOTCONNECTED Invalid host RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
9 APISYSERROR System error.

Remarks
Reset system will end the close intercept.
70 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query Close Intercept (42)

Description
The Query Close Intercept (42) function returns a code which indicates that the user tried to
close the application.
Prerequisite
Start Close Intercept (41)
Call Parameters
Function Number 42

Data String

a letter A-Z, which indicates the RIBM presentation space short name.

a (space) which indicates the currently connected RIBM presentation space.

Length 1

PS Position Not applicable.


Return Codes

0 APIOK A close event did not occur. The Query Close Intercept
(42) function was successful.
1 APINOTCONNECTED Not connected to a RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
8 APINOTAVAILABLE Unavailable operation. Your application did not call Start
Close Intercept (41).
9 APISYSERROR System error.
26 APIPSCHANGED A close intercept has occurred.
Reflection for IBM HLLAPI Reference 71

HLLAPI Function

Stop Close Intercept (43)

Description
The Stop Close Intercept (43) function turns off the Start Close Intercept (43) function, and
the user can use the close function.
Prerequisite
Connect Presentation Space (1)
Call Parameters
Function Number 43

Data String

a letter A-Z, which indicates the RIBM presentation space short name.

a (space) which indicates the currently connected RIBM presentation space.

Length Not applicable

PS Position Not applicable


Return Codes

0 APIOK The Stop Close Intercept (43) function was successful.


1 APINOTCONNECTED Not connected to a RIBM presentation space.
2 APIPARAMETERERROR Parameter error.
8 APINOTAVAILABLE Unavailable operation. Your application did not call
Start Close Intercept (41).
9 APISYSERROR System error.
72 Reflection for IBM HLLAPI Reference

HLLAPI Function

Start Keystroke Intercept (50)

Description
The Start Keystroke Intercept (50) function starts a process with a set of four functions that
can capture and filter keystrokes entered by a terminal operator. The intercepted keystrokes
may be received through Get Key (51), accepted, or rejected by sending a beep message with
the Post Intercept Status (52) function. A keystroke can then be replaced with another
keystroke using the Send Key (3) function. Your application can stop and disable the process
by calling Stop Keystroke Intercept (53).
Prerequisite
None.
Call Parameters

Function Number 50
Data String
1 a letter A-Z, indicating the HLLAPI short name.
a (space) which indicates the currently connected RIBM presen-
tation space.
2 Option code character:

D Intercept AID keystrokes only, non-AID keys will be sent to the


RIBM presentation space and only the AID keys will be captured by
the application.

L Intercept all keystrokes


3-6 Ignored by HLLAPI.
Length Recommended length of buffer: 256
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 73

Return Codes

0 APIOK The Start Keystroke Intercept (50) function was successful.


1 APINOTCONNECTED Invalid RIBM presentation space.
2 APIPARAMETERERROR Invalid character option specified. Only D or L is accepted.
4 APIPSBUSY Presentation space was busy.
9 APISYSERROR System error.

Remarks
Your application can intercept keystrokes for more than one RIBM presentation space at a
time. If you need to use Send Key (3) to send keystrokes to intercepted RIBM presentation
spaces HLLAPI requires a call to Connect Presentation Space (1).

Keystroke Intercept (50) ends if one of the following occurs:

The application calls the Reset System (21) function.

The application calls the Stop Keystroke Intercept (53) function.

The application terminates.

The keyboard buffer overflows see Get Key (51).


74 Reflection for IBM HLLAPI Reference

HLLAPI Function

Get Key (51)

Description
The Get Key (51) function allows your application to receive the AID keystrokes or all keystrokes
for the sessions that were specified with Start Keystroke Intercept (50).
Prerequisites
Prior call to Start Keystroke Intercept (50).
Call Parameters

Function Number 51
Data String String containing 8 bytes.
1 a letter A-Z, indicating the RIBM presentation space short
name.
a (space) which indicates the currently connected RIBM
presentation space.
2-8 Spaces to receive data in the return parameter.
Length 8 characters.
PS Position Not applicable.

Return Parameters

Data String String containing 8 bytes.


1 a letter A-Z, which indicates presentation
short name.
a (space) which indicates for the
currently connected RIBM presentation
space.
2 Code character, one of the following:
A = ASCII returned.
M = Keystroke mnemonics.
S = Special shift (Alt/Ctrl).
Reflection for IBM HLLAPI Reference 75

Bytes 3 - 8 Six bytes allocated keystroke buffer to internally queue intercepted


keys.
This buffer may contain one of the following:
Byte 3 = ASCII character and
byte 4 = X00. (The function returned a character key).
Byte 3 = ESC character (either @ or ESC character specified in Set
Session Parameters (9))
byte 4 = Keystroke mnemonics.
Bytes 5 through 8 may be similar to bytes 3 and 5 if the returned
keystroke mnemonic is longer than 2 bytes. See Remarks.

Return Codes

0 APIOK The Get Key (51) function was successful.


1 APINOTCONNECTED Invalid RIBM presentation space.
5 APIINHIBITED You specified D: (AID keystrokes only) in Start
Keystroke intercept (50). Non-AID keys are
inhibited by this session type.
8 APINOTAVAILABLE Your application must call Start Keystroke
Intercept (50) before using Get Key (51).
9 APISYSERROR System error.
20 APIUNDEFINEDKEY Undefined key combination was typed.
25 APINOKEYSTROKES Keystrokes not available.
31 APIKEYOVERFLOW Queue overflow; keystrokes were lost. See Remarks
for more information about this error code.

Remarks
When a keyboard queue overflow resulting in an error code (31) occurs, you may increase the
value of the calling length parameter for Start Keystroke Intercept (50), or call the Get Key (51)
function repeatedly to eliminate the error.

If LWAIT has been specified, Get Key (51) will not return control to the application until there
are keystrokes in the buffer.
76 Reflection for IBM HLLAPI Reference

The following Set Session Parameters (9) values affect this function:

TWAIT/LWAIT/NWAIT

ESC=char

The return parameter contains a RIBM presentation space short name identification, a code
character, and an allocated buffer used for keystroke buffer queues. Below are some examples
and a breakdown of this buffer:
DAc:

D RIBM presentation space short name


A keystrokes will be received as ASCII
c returning key lower case

AM@4:

A RIBM presentation space short name


M keystrokes will be returned as key mnemonics
@4 key returned is PF4

ES@A@2:

E the RIBM presentation space short name


S keystrokes will be returned in a special shift state
@A@2 keys returned are Alt + PF2
Reflection for IBM HLLAPI Reference 77

HLLAPI Function

Post Intercept Status (52)

Description
The Post Intercept Status (52) function analyzes a keystroke and either accepts or rejects it.

If the function rejects the keystroke through Get Key (51), it sounds a beep.
Prerequisite
Start Keystroke Intercept (50).
Call Parameters

Function Number 52
Data String 2-byte data string.
1 a letter A-Z, which indicates RIBM presentation
space short name.
a (space) which indicates for the currently
connected RIBM presentation space.
2 A = Accepted keystroke.
R = Rejected keystroke (beep).
Length Not applicable (2 is implied).
PS Position Not applicable.

Return Codes

0 APIOK The Post Intercept Status (52) function was successful.


1 APINOTCONNECTED Invalid RIBM presentation space.
2 APIPARAMETERERROR Invalid RIBM presentation space option.
8 APINOTAVAILABLE Start Keystroke Intercept (50) was not started for this
RIBM presentation space short name.
9 APISYSERROR System error.
78 Reflection for IBM HLLAPI Reference

HLLAPI Function

Stop Keystroke Intercept (53)

Description
The Stop Keystroke Intercept (53) function ends the intercept of keystrokes in the RIBM
presentation space. When the function is successful the terminal operator keystrokes return to
normal, and no keystrokes will intercepted.
Prerequisite
Start Keystroke Intercept (50).
Call Parameters

Function Number 53
Data String One of the following:
1 a letter A-Z, which indicates presentation short
name.
a (space) which indicates for the currently
connected RIBM presentation space.
Length Not applicable (1 is implied).
PS Position Not applicable.

Return Codes

0 APIOK The Stop Keystroke Intercept (53) function was


successful.
1 APINOTCONNECTED Invalid RIBM presentation space.
2 APIPARAMETERERROR Invalid option.
8 APINOTAVAILABLE Start Keystroke Intercept (50) was not started for this
RIBM presentation space short name.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 79

HLLAPI Function

Send File (90)

Description
The Send File (90) function transfers a file from your PC to the host RIBM presentation space
using the IND$FILE host file transfer function.
Prerequisite
Connect Presentation Space (1).
Call Parameters

Function Number 90
Data String Send command string. Maximum 128 bytes. Click here for a complete
description of the data string syntax for VM/CMS systems or here for
VMS/TSO systems.
Length Length of parameters string, or EOT if EOT mode is selected.
PS Position Not applicable.

Return Codes

2 APIPARAMETERROR Parameter error.


3 APIFTXCOMPLETE File transfer complete.
4 APIFTXSEGMENTED File transfer complete, records segmented.
9 APISYSERROR System error.
302 APIFILENOTFOUND File not found.
305 APIACCESSDENIED Access denied.
308 APIMEMORY Insufficient memory.
80 Reflection for IBM HLLAPI Reference

Remarks
You can send a file to CMS, TSO, CICS systems. Send File (90) does not support AS/400 file
transfers.

Send File is not supported on AS/400.

The target host RIBM presentation space must be ready to receive the file, which means that
you should be logged on to the host computer, have the keyboard enabled, have no other file
transfer running at the same time to the same RIBM presentation space, and have the system
prompt displayed.

The following Set Session Parameters (9) values affect this function:
QUIET/NOQUIET

STRLEN/STREOT

TIMEOUT=c/TIMEOUT=0

EOT=c
Reflection for IBM HLLAPI Reference 81

HLLAPI Function

Receive File (91)

Description
The Receive File (91) function transfers a file from the host RIBM presentation space to the PC
using the IND$FILE host file transfer function.
Prerequisites
None.
Call Parameters

Function Number 91
Data String Receive command string. Maximum 128 bytes. Click here for a
complete description of the data string syntax for VM/CMS
systems or here for VMS/TSO systems.
Length Length of parameters string, or EOT if EOT mode is selected.
PS Position Not applicable.

Return Codes

2 APIPARAMETERROR Parameter error.


3 APIFTXCOMPLETE File transfer complete.
4 APIFTXSEGMENTED File transfer complete, records segmented.
9 APISYSERROR System error.
302 APIFILENOTFOUND File not found.
305 APIACCESSDENIED Access denied.
308 APIMEMORY Insufficient memory.
82 Reflection for IBM HLLAPI Reference

HLLAPI Function

Convert (99)

Description
The Convert (99) function converts a position on the RIBM presentation space to a display
row/column coordinate, or a display row/column coordinate to an RIBM presentation space
position.
Prerequisites
None.
Call Parameters

Function Number 99
Data String 2-byte data string.
1 One of the following:
a letter A-Z, which indicates presentation short name.
a (space) which indicates for the currently connected RIBM
presentation space.
2 P or R:
P = converts from Position to Row/Column.
R = converts from Row/Column to Position. See Length and PS
Position parameter below.
Length Row number on the RIBM presentation space. Valid row value is
between 1 and the maximum number of rows depending on the model.
Not applicable when P is specified in the String parameter.
PS Position When R is specified, column number on RIBM presentation space.
Valid column value is between 1 and the max presentation space
position, usually 1920.
When P is specified, the RIBM presentation space position.
A valid value must be between 1 and maximum presentation space
buffer size.
Reflection for IBM HLLAPI Reference 83

Return Parameters
The Convert (99) function does not return parameters.
Return Codes

0 Incorrect RIBM presentation space position or column.


>0 The converted RIBM presentation space position or column.

9998 APIINVALIDPSID Invalid RIBM presentation space short name.


9999 APIINVALIDRC Invalid character in the Length parameter. Letter is
not P or R.

Remarks
The Convert (99) function does not update the cursor position.

The Convert (99) function calculates the position, taking the model number in consideration.
84 Reflection for IBM HLLAPI Reference

HLLAPI Function

Connect Window Services (101)

Description
The Connect Window Services (101) function allows the client application to manage the
RIBM presentation space windows.
Prerequisite
None.
Call Parameters

Function Number 101


Data String a letter A-Z, which indicates the RIBM presen-
tation space short name.
a (space) which indicates the currently
connected RIBM presentation space.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 APIOK The Connect Window Services (101) function was


successful.
1 APINOTCONNECTED Invalid RIBM presentation space short name.
9 APISYSERROR System error.
11 APIUNAVAILABLE The RIBM presentation space is busy.
Reflection for IBM HLLAPI Reference 85

HLLAPI Function

Disconnect Window Services (102)

Description
The Disconnect Window Services (102) function disconnects the HLLAPI application and the
RIBM presentation space windows.
Prerequisite
Connect Window Services (101).
Call Parameters

Function Number 102


Data String a letter A-Z, which indicates RIBM presen-
tation space short name.
a (space) which indicates for the
currently connected presentation.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 APIOK The Disconnect Window Services (102) function was


successful.
1 APINOTCONNECTED Invalid RIBM presentation space short name.
9 APISYSERROR System error.

Remarks
When HLLAPI has called Disconnect Window Services (102) it no longer manages the RIBM
presentation space window.

Before you exit the application, exit with a call to Disconnect Window Services (102) so all
connected RIBM presentation spaces will disconnect and no outstanding connection will be
canceled.
86 Reflection for IBM HLLAPI Reference

HLLAPI Function

Query Window Coordinates (103)

Description
The Query Window Coordinates (103) function returns window coordinates on the
presentation.

A return code of "0,0" indicates the top-left coordinates.


Prerequisite
Connect Window Services (101).
Call Parameters

Function Number 103


Data String a letter A-Z, which indicates the RIBM presentation
space short name.
a (space) which indicates the currently
connected RIBM presentation space.
Length Defaults to 17.
PS Position Not applicable.

Return Parameters
Data String:

Bytes 1 Presentation space short name. (A-Z)

Bytes 2-5 Specifies the X-coordinates of the windows upper-left corner.

Bytes 6-9 Specifies the Y-coordinates of the windows lower-right corner.

Bytes 10-13 Specifies the X-coordinates of the windows lower-right corner.


Bytes 14-17 Specifies the Y-coordinates of the windows upper-left corner.
Reflection for IBM HLLAPI Reference 87

Return Codes

0 APIOK The Query Window Coordinates (103) function was successful.


1 APINOTCONNECTED Invalid RIBM presentation space short name.
9 APISYSERROR System error.

Remarks
This function is not supported for 5250.

HLLAPI Function

Window Status (104)

Description
The Window Status (104) function can be used to query or change a windows RIBM presen-
tation space size, location, or visibility. You can also move, maximize or minimize a specified
window.
Prerequisite
Connect Window Services (101).
Call Parameters

Function Number 104


Data String See Window Status calling format.
Length A value between 16 or 20.
PS Position Not applicable

Return Codes

0 APIOK The Window Status (104) function completed successfully.


1 APINOTCONNECTED Invalid RIBM presentation space short name.
2 APIPARAMETERERROR Parameter specification error.
9 APISYSERROR System error.

Remarks
This function is not supported in 5250 sessions.
88 Reflection for IBM HLLAPI Reference

HLLAPI Function

Change PS Window Name (106)

Description
The Change PS Window Name (106) function allows an application to reset or change the
RIBM presentation space window name.
Prerequisite
Connect Window Services (101).
Call Parameters

Function Number 106


Data String One of the following:
Byte 1 a letter A-Z, which indicates presentation short name.
a (space) which indicates for the currently connected
presentation.
Byte 2 A change request value:
X01 Change the RIBM presentation space window name.
X02 Reset the RIBM presentation space window name.
Bytes 3-260 An ASCII string that specify the new name. This string must end
with a null character.
Length A length between 3 and 260.
PS Position Not applicable

Return Codes

0 APIOK The Change PS Window Name (106) function was


successful.
1 APINOTCONNECTED Invalid RIBM presentation space short name.
2 APIPARAMETERERROR Parameter specification error.
9 APISYSERROR System error.
Reflection for IBM HLLAPI Reference 89

HLLAPI Function

Run Profile (1000)

Description
Run Profile starts an RIBM presentation space with the specified settings file.
Prerequisite
None
Call Parameters

Function Number 1000


Data String Name, including the extension and full path, of the settings file to load.
Length Constant or value that determines how the RIBM presentation space is
displayed. See below.

Constant Value Description

0 SW_HIDE Hides the window.


1 SW_SHOWNORMAL Displays a window.
2 SW_SHOWMINIMIZED Shows the window as an icon.
3 SW_SHOWMAXIMIZED Shows the window and displays it as a
maximized window.
4 SW_SHOWNOACTIVATE Displays a window in its most recent size
and position. The current active window
remains active.
5 SW_SHOW Shows a window and displays it in its
current size and position.
6 SW_MINIMIZE Minimizes the specified window and
activates the top-level window in the
system's list.
7 SW_SHOWMINNOACTIVE Shows the window as an icon. The
current active window remains active.
90 Reflection for IBM HLLAPI Reference

Constant Value Description

8 SW_SHOWNA Shows the window in its current state.


The current active window remains
active.
9 SW_RESTORE Restores a minimized or maximized
window to its original size. (Same as
SW_SHOWNORMAL).

PS Position Not applicable.


Return Codes

0 APIOK The Run Profile (1000) function was successful.


2 APIPARAMETERERROR Invalid profile parameter.
9 APISYSERROR System error. The profile was found. The executable
file was not found.
Reflection for IBM HLLAPI Reference 91

HLLAPI Function

Get Session HWND (1002)

Description
The Get Session HWND (1002) function returns the instance handle of the currently
connected RIBM presentation space.
Prerequisite
None.
Call Parameters

Function Number 1002


Data String An applications short name.
Length Must be 4.
PS Position Not applicable.

Return Parameters
Data String The instance handle.
Return Codes

1 APINOTCONNECTED Application is not connected to an RIBM presentation space.


9 APISYSERROR System error.
92 Reflection for IBM HLLAPI Reference

EHLLAPI Reference

EHLLAPI Return Codes

Summary of EHLLAPI Return Codes

Number Code Description

0 APIOK The function call was successfully completed.


1 APINOTCONNECTED Your EHLLAPI application is not connected to a
presentation space. Check the presentation space ID.
2 APIPARAMETER- At least one EHLLAPI parameter was incorrect. Check
ERROR the parameter length or order.
3 APIFTXCOMPLETE File transfer was successfully completed.
4 APIFTXSEGMENTED File transfer complete with segmented records.
4 APIPSBUSY Function successfully completed, but the presentation
space is busy. The X CLOCK (Mainframe) or II
(AS/400) is displayed on the OIA. If sending data, some
keystrokes could not be sent.
5 APIINHIBITED Host session inhibited, not all keystrokes could be sent.
The application may try to send keystrokes or data to a
protected field.
6 APITRUNCATED Data was truncated. The data length or the buffer size
may be incorrect.
7 APIPOSITIONERROR The specified presentation space position is invalid.
Check the presentation space size with the Query
Session function. The position must be within 0 and
the maximum size of the presentation space.
8 APINOTAVAILABLE The function is not available. Conflicting functions or
missing prerequisite.
9 APISYSERROR A system error was encountered. Use the Query System
(20) function to determine the cause of the problem
then call Reset System or terminate the application.
Reflection for IBM HLLAPI Reference 93

Number Code Description

10 APINOTSUPPORTED This function is not supported for the EHLLAPI client


program.
11 APIUNAVAILABLE The resource is unavailable.
12 APIPSENDED The session stopped
20 APIUNDEFINEDKEY Undefined keystroke combination.
21 APIOIAUPDATE The OIA was updated.
22 APIPSUPDATE Presentation space was updated.
23 APIBOTHUPDATE Both the OIA and presentation space were updated.
24 APINOFIELD No such field was found. The presentation space
may be unformatted.
25 APINOKEYSTROKES There are no keystrokes available in the keyboard
buffer.
26 APIPSCHANGED The OIA or presentation space was updated.
27 APIFTXABORTED File transfer terminated by a Ctrl+Break,
or because file transfer timed out.
28 APIZEROLENFIELD The field length is 0 bytes.
31 APIKEYOVERFLOW Keystroke overflow in the keyboard buffer.
9998 APIINVALIDPSID An invalid presentation space ID was specified or a
system error occurred.
9999 APIINVALIDRC An invalid Row or Column parameter was specified.
94 Reflection for IBM HLLAPI Reference

HLLAPI Reference

HLLAPI File Transfer with VM/CMS

[d:][path]filename[.ext] w:fn [ft] [fm] [(options]

VM/CMS File Transfer Parameters

Parameter Description

[d:] Defines a disk drive where the PC file will be sent to or received
from. If you dont specify the drive, file transfer defaults to the
current drive.
[path] Path for the PC file to be sent or target file to be received. If you
dont specify the path, it defaults to the Reflection for IBM \User
directory on the PC.
filename File name of the file to be sent or received.
[.ext] File extension of the file to be sent or received.
w: Session's short name for a CMS session (followed by a colon) for
sending or receiving files. A letter between A - Z. If you dont,
the host session in focus would be the target.
fn File name of the file being sent or received from the host session.
[ft] The file type of the host file to be sent or received, if any.
[fm] Optional parameter which indicates the host file mode. If Send
File (90), this parameter indicates to CMS which disk drive the
file is sent to.
(options The Options parameter is preceded by a single left parenthesis.
See below for VM/CMS File Transfer Options.
Reflection for IBM HLLAPI Reference 95

VM/CMS File Transfer Options

Option Description

append Appends a transferred file to the end of an existing file. append


overrides specified values for the lrecl and recfm options.
ascii Converts ASCII to EBCDIC when EHLLAPI sends a file to the
host session, and converts EBCDIC to ASCII when the PC session
receives a file from the host session. If the file is a text file, ASCII
mode is recommended.
bufsize Enables EHLLAPI to select a buffered file transfer option.

BUFSIZE = 2

BUFSIZE = 4

BUFSIZE = 8

BUFSIZE = 32
crlf Deletes the carriage return/line feed characters during Send (90),
and appends them during Receive (91). Text data usually
contains a crlf character at the end of each line. If you delete these
characters the file will be easier to read
lrecl n Specifies that the host file contains fixed-length records. If strings
are shorter than n, the buffers will be padded with space
characters. Send File (90) only.
recfm f Specifies that the file will contain variable length records.

Use of the recfm v option without the crlf option is recommended


when padding of mainframe records or deletion of trailing spaces
must not occur.
96 Reflection for IBM HLLAPI Reference

HLLAPI Reference

File Transfer with VMS/TSO

[d:][path]filename[.ext] w:dsn [(member)] [lpw] [options]

VMS/TSO File Transfer Parameters

Parameter Description

[d:] Defines a drive for the PC file to be sent to or received from. If you dont
specify the drive, file transfer defaults to the current drive.
[path] Path for the PC file to be sent or target file to be received.
filename File name of the file to be sent or received.
[.ext] File extension of the file to be sent or received..
w: Sessions short name for a TSO session (followed by a colon) for sending or
receiving files. A letter between A - Z. If you dont, the host session in focus
would be the target.
w: The target session's short name in which you have established a TSO session
(followed by a colon) for sending or receiving files. For example, in session
Session1, A would be the session's short name. If not specified, the first
open mainframe session would be the target.
dsn TSO dataset name you assign to the file when you send it to the host session,
or the TSO dataset name of the file to be received on the PC session.
[(member)] Optional parameter that tells TSO to save (when sending), or if the file was
saved (when receiving) as a partitioned dataset. Partitioned dataset files
save mainframe disk space.
[lpw] Send File (90)
The parameter tells TSO to be password protected. You must create a
password if you want your file protected.

Receive File (91)


Include this parameter with the appropriate password if the file was
password protected.
options See the VMS/TSO File Transfer Options below.
Reflection for IBM HLLAPI Reference 97

VMS/TSO File Transfer Options

Option Description

append Appends a transferred file to the end of an existing file. append overrides
specified values for the lrecl and recfm options.
ascii Converts ASCII to EBCDIC when EHLLAPI sends a file to the host session,
and converts EBCDIC to ASCII when the PC session receives a file from the
host session. If the file is a text file, ASCII mode is recommended.
crlf Deletes the carriage return/line feed characters during Send (90), and
appends them during Receive (91). Text data usually contains a crlf
character at the end of each line. If you delete these characters the file
will be easier to read
lrecl n Specifies that the host file contains fixed-length records. If strings are
shorter than n, the buffers will be padded with space characters. Send File
(90) only.
blksize(n) Block size of the host file dataset, where n is the length in bytes of a data
block. If you omit blksize, the default is lrecl + 4 for new files. If you are
appending or replacing a dataset, blksize is ignored. Send File (90) only.
recfm(f) The host file will contain fixed-length records. Records are padded with
space characters if they are shorter than that specified with lrecl or the
default length.
recfm(u) Records of undetermined length. Send File (90) only.
recfm(v) Records of variable length records.
-B Do not use structured fields.
-S Structured field file transfer.
space Amount of space to be allocated for a new dataset.
98 Reflection for IBM HLLAPI Reference

HLLAPI Reference

HLLAPI AID Keys

The table below shows the valid AID keys for 3270, 5250, and asynchronous sessions.
3270 AID keys 5250 AID keys Asynchronous AID keys
Attn Clear Function keys
Clear Enter Enter
Cursor Select PF keys Numlock
Enter Help Number Pad /
PF keys PA1 - PA3 Number Pad *
PA1 - PA3 Page Down Number Pad -
System Request Page Up
Print
System Request
Test Request
Reflection for IBM HLLAPI Reference 99

HLLAPI Reference

HLLAPI Window Status

Request Option X01


Set window status - a 16-byte string with the following format:

Byte Description

Byte 1 a letter A-Z, which indicates presentation short name.

a (space) which indicates for the currently connected presentation space.


Byte 2 X01 WINDOWSTATUS_SET for Set status.
Bytes 3-4 If the request option is Set Status the following codes are valid:
X0001 WINDOWSTATUS_SIZE
Change the window size (not valid with minimize, maximize, restore, or
move).

X0002 WINDOWSTATUS_MOVE
Move the window x or y position (not valid with minimize, maximize, size,
or restore).

X0004 WINDOWSTATUS_ZORDER.
Specifies ZORDER placement.

X0008 WINDOWSTATUS_SHOW
Set the window to visible.
100 Reflection for IBM HLLAPI Reference

Byte Description

X0010 WINDOWSTATUS_HIDE
Set the window to invisible.

X0080 WINDOWSTATUS_ACTIVATE
Activate the window. Use the _ZORDER, otherwise set focus to the window
and place it in the foreground.

X0100 WINDOWSTATUS_DEACTIVATE
Deactivate the window. Use the _ZORDER placement if specified, otherwise
place it in the background.

X0400 WINDOWSTATUS_MINIMIZE
Set the window to minimized (not valid with maximize, restore, size, or move).

X0800 WINDOWSTATUS_MAXIMIZE
Set the window to maximized (not valid with minimize, restore, size, or move).

X1001 WINDOWSTATUS_RESTORE
Restore the window (not valid with maximize, minimize, size, or move).
Bytes 5-6 Specifies the x-coordinate of the upper-left corner of the window. Ignored if
the move option is not set.
Bytes 7-8 Specifies the y-coordinate of the upper-left corner of the window. Ignored if
the move option is not set
Bytes 9-10 Specifies the X window size (width).
Bytes 11-12 Specifies the Y window size (height)

Request Option X02


Query window status - a 16-byte string with the following format:

Byte Description

Byte 1 Short name session ID of the desired host session, or space or null for the
current host session.
Byte 2 X02 WINDOWSTATUS_QUERY for query status.
Reflection for IBM HLLAPI Reference 101

Byte Description

Bytes 3-4 An integer containing WINDOWSTATUS_NULL. The following are


possible return values. More than one status is possible.

X0001 WINDOWSTATUS_SHOW
The window is visible.

X0001 WINDOWSTATUS_HIDE
The window is invisible.

X0001 WINDOWSTATUS_ACTIVATE
The window is activated.
X0001 WINDOWSTATUS_DEACTIVATE
The window is deactivated.

X0001 WINDOWSTATUS_MINIMIZE
The window is minimized.

X0001 WINDOWSTATUS_MAXIMIZE
The window is maximized.
Bytes 5-6 Specifies the x-coordinate of the upper-left corner of the window. Ignored
if the move option is not set.
Bytes 7-8 Specifies the y-coordinate of the upper-left corner of the window. Ignored
if the move option is not set
Bytes 9-10 Specifies the X window size (width).
Bytes 11-12 Specifies the Y window size (height)
Bytes 13-16 Specifies the z-order placement of the window (only valid for the set
option when the _ZORDER option is specified). Valid values are:

X0001 WINDOWSTATUS_FRONT
Place window in front.

X0001 WINDOWSTATUS_BACK
Place window in back.
102 Reflection for IBM HLLAPI Reference

Request Option X03


Query extended window status - a 20-byte string with the following format:
Byte Description
Byte 1 Short name session ID of the desired host session, or space or null for the
current host session.
Byte 2 X03 WINDOWSTATUS_EXTQUERY for query extended status.
Bytes 3-4 An integer containing WINDOWSTATUS_NULL. The following are
possible return values. More than one status is possible.

X0001 WINDOWSTATUS_SHOW
The window is visible.

X0001 WINDOWSTATUS_HIDE
The window is invisible.

X0001 WINDOWSTATUS_ACTIVATE
The window is activated.

X0001 WINDOWSTATUS_DEACTIVATE
The window is deactivated.
X0001 WINDOWSTATUS_MINIMIZE
The window is minimized.

X0001 WINDOWSTATUS_MAXIMIZE
The window is maximized.
Bytes 5-6 Specifies the current font height. The size assumes a fixed-pitch font
including any inter-column spacing (this value times the number of
displayed columns should equal the width of the presentation space).
Bytes 7-8 Specifies the current font width. The size includes any inter-line spacing
(this value times the number of displayed rows should equal the height of
the presentation space).
Reflection for IBM HLLAPI Reference 103

Bytes 9-10 Specifies the distance from the left edge of the window to the first
displayed column of the host screen, or zero if the host presentation
space exactly fits the window.
Bytes 11-12 Specifies the distance from the top of the window to the first displayed
row of the host screen, or zero if the host presentation space exactly fits
the window.
Bytes 13-14 Specifies the number of the first visible row of the presentation space.
This is normally one unless only a portion of the presentation space is
visible in the window.
Bytes 15-16 Specifies the number of the first visible column of the presentation space.
This is normally one unless only a portion of the presentation space is
visible in the window.
Bytes 17-20 Specifies the window handle of the emulator session. For Win16 handles,
only positions 17-18 are used.
104 Reflection for IBM HLLAPI Reference

HLLAPI Reference

HLLAPI ASCII Mnemonics

This table is used when your application is calling Send Key (3) or Get Key (51).

Meaning Mnemonic
@ @@
Alt @A
Alt Cursor @$
Attention @A@Q
Backspace @<
Backtab (Left Tab) @B
Clear @C
Cmd (function) Key @A@Y
Cursor Down @V
Cursor Left @L
Cursor Right @Z
Cursor Select @A@J
Cursor Up @U
Delete @D
Dup @S@x
End @q
Enter @E
Erase EOF @F
Erase Input @A@F
Field Exit @A@E
Field Mark @S@y
Field - @A@-
Reflection for IBM HLLAPI Reference 105

Meaning Mnemonic
Field + @A@+
Help @H
Hexadecimal @A@X
Home @0 (zero)
Insert @I
Insert Toggle @A@I
Local Print @P
New Line @N
Page Up @u
Page Down @v
Print (PC) @A@t
Print Screen @A@T
Record Backspace @A@<
Reset @R
Shift @S
Sys Request @A@H
Tab (Right Tab) @T
Test @A@C
PA1 @x
PA2 @y
PA3 @z
PA4 @+
PA5 @%
PA6 @&
PA7 @
PA8 @(
106 Reflection for IBM HLLAPI Reference

Meaning Mnemonic
PA9 @)
PA10 @*
PF1/F1 @1
PF2/F2 @2
PF3/F3 @3
PF4/F4 @4
PF5/F5 @5
PF6/F6 @6
PF7/F7 @7
PF8/F8 @8
PF9/F9 @9
PF10/F10 @a
PF11/F11 @b
PF12/F12 @c
PF13/F13 @d
PF14/F14 @e
PF15/F15 @f
PF16/F16 @g
PF17/F17 @h
PF18/F18 @i
PF19/F19 @j
PF20/F20 @k
PF21/F21 @l
PF22/F22 @m
PF23/F23 @n
PF24/F24 @o
Reflection for IBM HLLAPI Reference 107

EHLLAPI Reference

Presentation Space Buffer Sizes


Models 3270 Resolution Size without EABs Size with EABs
2 24x80 1920 3840
3 32x80 2560 5120
4 43x80 3440 6880
5 27x132 3564 7128

Models 5250 Resolution Size without EABs Size with EABs


2 24x80 1920 Not supported
5 27x132 3564 Not supported

WinHLLAPI Reference

WinHLLAPI Functions Alphabetical List

Click a WinHLLAPI function below for a complete description:

Change PS Window Name (106)


Connect Presentation Space (1)
Connect Window Services (101)
Convert (99)
Copy Field to String (34)
Copy OIA (13)
Copy Presentation Space (5)
Copy Presentation Space to String (8)
Copy String to Field (33)
Copy String to Presentation Space (15)
Disconnect Presentation Space (2)
Disconnect Window Services (102)
Display Cursor (37)
Find Field Length (32)
Find Field Position (31)
Get Key (51)
108 Reflection for IBM HLLAPI Reference

Get Session HWND (1002)


Pause (18)
Post Intercept Status (52)
Query Close Intercept (42)
Query Cursor Location (7)
Query Field Attribute (14)
Query Host Update (24)
Query Session Status (22)
Query Sessions (10)
Query System (20)
Query Window Coordinates (103)
Receive File (91)
Release (12)
Reserve (11)
Reset System (21)
Run Profile (1000)
Search Field (30)
Search Presentation Space (6)
Send File (90)
Send Key (3)
Set Cursor (40)
Set Session Parameters (9)
Start Close Intercept (41)
Start Host Notification (23)
Start Keystroke Intercept (50)
Stop Close Intercept (43)
Stop Host Notification (25)
Stop Keystroke Intercept (53)
Wait (4)
Window Status (104)
Reflection for IBM HLLAPI Reference 109

HLLAPI Reference

WinHLLAPI Functions Numerical List

Click a WinHLLAPI function below for a complete description:

Connect Presentation Space (1)


Disconnect Presentation Space (2)
Send Key (3)
Wait (4)
Copy Presentation Space (5)
Search Presentation Space (6)
Query Cursor Location (7)
Copy Presentation Space to String (8)
Set Session Parameters (9)
Query Sessions (10)
Reserve (11)
Release (12)
Copy OIA (13)
Query Field Attribute (14)
Copy String to Presentation Space (15)
Pause (18)
Query System (20)
Reset System (21)
Query Session Status (22)
Start Host Notification (23)
Query Host Update (24)
Stop Host Notification (25)
Search Field (30)
Find Field Position (31)
Find Field Length (32)
Copy String to Field (33)
Copy Field to String (34)
Display Cursor (37)
Set Cursor (40)
Start Close Intercept (41)
Query Close Intercept (42)
Stop Close Intercept (43)
Start Keystroke Intercept (50)
110 Reflection for IBM HLLAPI Reference

Get Key (51)


Post Intercept Status (52)
Stop Keystroke Intercept (53)
Send File (90)
Receive File (91)
Convert (99)
Connect Window Services (101)
Disconnect Window Services (102)
Query Window Coordinates (103)
Window Status (104)
Change PS Window Name (106)
Run Profile (1000)
Get Session HWND (1002)
Reflection for IBM HLLAPI Reference 111

WinHLLAPI Function

Connect Presentation Space (1)

Description
The Connect Presentation Space function connects and links a WinHLLAPI application to an
RIBM Presentation Space (PS). Reflection allows up to 16 RIBM presentation spaces to be run
simultaneously.
Prerequisite
An RIBM presentation space must be configured with a unique short name before any
WinHLLAPI applications can connect to it.
Function Calls

WORD WinHLLAPI(
LPWORD CONNECTPS, // Pointer to function number
LPSTR lpbyString, // Pointer to length string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters
Your client application program must pass the following parameters to this function:

Function number 1
Data string A letter of the alphabet (A-Z) which represents the RIBM
presentation space short name.
Data length Not applicable.
PS position Not applicable.
112 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK Function was successfully completed. The RIBM presen-


tation space is ready for input.
1 WHLLNOTCONNECTED The specified RIBM presentation space is invalid. Look over
the RIBM presentation space short name.
4 WHLLPSBUSY Successful connection, but RIBM presentation space is busy.
5 WHLLINHIBITED Successful connection, but RIBM presentation space is
locked.
9 WHLLSYSERROR System error.
11 WHLLUNAVAILABLE RIBM presentation space is unavailable and in use by
another session.

Remarks
Connect Presentation Space (1) connects you to one RIBM presentation space. If a HLLAPI
application tries to connect to a new RIBM presentation space while already connected, the
application will be disconnected and then the application will attempt to connect to the new
RIBM RIBM presentation space. The application will be disconnected from the old RIBM
presentation space even if ConnectPS does not complete successfully.

The following functions disconnect the client application from the connected RIBM
presentation space:

Disconnect presentation space (2)

Reset System (21)

The functions below require that client programs first make a prerequisite call to the Connect
Presentation Space function.

Function 2 Disconnect Presentation Space (2)


Function 3 Send Key (3)

Function 4 Wait (4)

Function 5 Copy Presentation Space (5)


Function 6 Search Presentation Space (6)
Reflection for IBM HLLAPI Reference 113

Function 7 Query Cursor Location (7)

Function 8 Copy Presentation Space to String (8)

Function 11 Reserve (11)

Function 12 Release (12)


Function 13 Copy OIA (13)

Function 14 Query Field Attribute (14)

Function 15 Copy String to Presentation Space (15)

Function 30 Search Field (30)

Function 31 Find Field Position (31)

Function 32 Find Field Length (32)

Function 33 Copy String to Field (33)

Function 34 Copy Field to String (34)

Function 40 Set Cursor (40)


114 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Disconnect Presentation Space (2)

Description
The Disconnect Presentation Space (2) function disconnects your client application from its
currently connected RIBM presentation space.

After calling this function, you cannot call functions that depend on a connection to an RIBM
presentation space. You will be automatically disconnected from your currently connected RIBM
presentation space when you connect to another presentation space.

Your client application should always disconnect when exiting.


Prerequisite:
Connect Presentation Space (1)
Function Calls

WORD WinHLLAPI(
LPWORD DISCONNECTPS, // Pointer to function number
LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 2
Data String Not applicable
Length Not applicable
PS Position Not applicable

Return Codes

0 WHLLOK Successful disconnect.


1 WHLLNOTCONNECTED The client is currently not connected to any presentation
space.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 115

Remarks
Disconnect Presentation Space (2) does not restore the values in Set Session Parameters (9) when
you exit the client application. You may call the Set Session Parameters (9) or Reset System (21)
function to restore to the default values.

WinHLLAPI Function

Send Key (3)

Description
Send Key (3) is used to send a string of up to 255 keystrokes to the currently connected RIBM
presentation space as if they had been entered by an operator. The keyboard must be unlocked
and not in a busy state. Send Key (3) allows sessions to exchange keystrokes that are not available
from the keyboard, or are not represented by an ASCII value. For example, an operator may not
be able to produce the keystrokes necessary for a session, so Send Key (3) can produce the appro-
priate keystroke.
Prerequisite
Connect Presentation Space (1).
Function Calls
WORD WinHLLAPI(

LPWORD SENDKEY, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 3
Data String A string of maximum 255 characters including keystrokes and ASCII
mnemonics which the client sends to host presentation space.
Length String length, if STRLEN is used. Not used if STREOT option is used
and in such case, the string must end with an EOT.
PS Position Not applicable.
116 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK The Send Key function was successful.


1 WHLLNOTCONNECTED Your client application is not connected to a valid presen-
tation space.
2 WHLLPARAMETERERROR An incorrect parameter was sent to WinHLLWHLL.
4 WHLLPSBUSY Host RIBM presentation space busy, not all keystrokes
could be sent.
5 WHLLINHIBITED Host RIBM presentation space inhibited, not all
keystrokes could be sent.
9 WHLLSYSERROR System error.

Remarks
You can use all keyboard combinations to represent a string sent to the RIBM presentation space,
including 3270 and 5250 function keys in ASCII mnemonics, by using an escape character
(default value is @) followed by the appropriate key code.

Each key code represents the actual key that is being sent. When sending text keystrokes, be sure
the codes are entered just as you want them to be received, including the correct case.

If your keystroke string is longer than 255 characters, which is the Send Key functions limit, you
can use several calls to the Send Key (3) function. If you need to send numerous keystrokes, it is
faster to use Copy String to Presentation Space (15) or Copy String to Field (33). An efficient way
to send data to the RIBM presentation space is to first use the Copy String to Presentation Space
(15) to send a large amount of text and then finish the string with another call to Send Key (3) to
send the AID. Use the Query Field Attribute (14) function to check the status of the receiving
field.

To ensure that the keyboard is not locked, your application may call the Wait (4) function.

After the first AID key is sent, keystrokes are no longer accepted and the rest of the string is
ignored.

The following Set Session Parameters (9) values affect this function:

AUTORESET/NORESET

STRLEN/STREOT
EOT=c

ESC=c
Reflection for IBM HLLAPI Reference 117

WinHLLAPI Function

Wait (4)

Description
The Wait (4) function determines whether the RIBM presentation space can accept keystrokes
from a HLLAPI application. The Wait (4) function can be used to query the current status on
the XCLOCK and/or XSYSTEM parameter of the OIA.
Prerequisite
Connect Presentation Space (1)
Function Call

WORD WinHLLAPI(
LPWORD WAIT, // Pointer to function number
LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,WAIT,lpbyString,lpwLength,lpwReturnCode)
Call Parameters

Function Number 4
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.
118 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK Function was successful. The keyboard is unlocked and


ready for input.
1 WHLLNOTCONNECTED The client application is not connected to a valid presen-
tation space.
4 WHLLPSBUSY Timed out while waiting.
5 WHLLINHIBITED Keyboard is locked.
9 WHLLSYSERROR System error.

Asynchronous Mode
In async mode, the control returns to the client and the presentation space will inform the client
through windows message registered using RegisterWIndowMessage with WinHLLAPIAsync.

An asynchronous Wait (4) call immediately returns control to your WinHLLAPI application,
releasing the application to do other tasks while waiting. However if NWAIT is specified, the
WinHLLAPI Async call will word same the same as WinHLLAPI. Look at the Async event for
more details.
Remarks
The Wait (4) function by itself may not be a sufficient method for determining when the host is
ready for input. To verify that the correct host panel is displayed on RIBM presentation space,
you might want to search for specific keywords or prompts, using the Search Field (30) function,
Query Cursor Location (7) function, or Search Presentation Space (6) function.
Reflection for IBM HLLAPI Reference 119

WinHLLAPI Function

Copy Presentation Space (5)

Description
The Copy Presentation Space (5) function copies the contents of the entire RIBM presentation
space into a string buffer. The size of the buffer will be the size of the RIBM presentation space
unless you decide to copy extended attributes (EABs) where it will be more. If you decide to
copy EABs, the string length must be at least twice the size of the RIBM presentation space to
fit the EAB values into the buffer.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD COPYPS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 5
Data String The data buffer defined in the client application program should
be as large as the RIBM presentation space of the entire display
buffer. If EABs are set up to be copied, this buffer must be at least
double the size for the model.
Length Not applicable.
PS Position Not applicable.

Return Parameter
Contains the entire contents of the RIBM presentation space. The size of this parameter is
depends on the value you entered in the Data String parameter.
120 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK Function was successful. WinHLLAPI copied the content to


the client application buffer.
1 WHLLNOTCONNECTED The client application is not connected to the RIBM presen-
tation space.
4 WHLLPSBUSY The content was copied to the buffer. The RIBM presentation
space is waiting for a response.
5 WHLLINHIBITED The content was copied to the buffer; keyboard is locked.
9 WHLLSYSERROR System error.

Remarks
Your client application can determine the size of the RIBM presentation space by calling Query
Sessions (10). To determine if EABs are set, can call Query Field Attribute (14).

If you need to copy only a field or a specific part of the RIBM presentation space, use Copy
Presentation Space to String (8) or Copy Field to String (34) instead.

Copy Presentation Space (5) translates the entire RIBM presentation space to ASCII code.
EABs and other characters not represented by an ASCII value are translated to blanks. To copy
EABs and ATTRIBs, set the Set Session Parameter, EAB and ATTRB parameter respectively.

The following Set Session Parameters (9) values affect this function:

ATTRB/NOATTRB

EAB/NOEAB
XLATE/NOXLATE

The following HLLAPI Style Bits effect this function: Propogate EAB, Wait a Second, Translate
5250 Attributes to 3270, and Always Blank. See HLLAPI Style Bit topic in R8win.hlp for more
information.
Reflection for IBM HLLAPI Reference 121

WinHLLAPI Function

Search Presentation Space (6)

Description
The Search Presentation Space (6) function looks for the specified string. The search can start
from a specified position on the RIBM presentation space and scan forward or backward from
that position. The method of scanning is specified by Set Session Parameters (9), SRCHALL,
SRCHFROM, SCRCHFRWD, SRCHBKWD.

This function is useful if you are looking for a particular keyword on a host screen.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD SEARCHPS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 6
Data String Data string to search for, which you define in the client
program. Note that the string is case sensitive; upper and
lower case letters need to be an exact match.
Length Target buffer length.
PS Position RIBM presentation space position where to start the search
function (SRCHFRWD), or to end (SRCHBKWD). If
SRCHALL is set, this parameter is ignored.
122 Reflection for IBM HLLAPI Reference

Return Parameters
This function returns a length parameter.

Length:

0 The Search function did not find the string.


>0 The returning length is the starting presentation position where the string was found.

Return Codes

0 WHLLOK The function was successful. The string was found.


1 WHLLNOTCONNECTED Your client application is not connected to a host
RIBM presentation space.
2 WHLLPARAMETERERROR Incorrect parameter error.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD The function could not find the string.

Remarks
The Search Presentation Space (6) function searches for a specific host string, a panel, or a
message from the host on the RIBM presentation space. If your client application requires a
specific panel or message before sending data back to the host, you can use Search Presentation
Space (6) to find the string.

Use this function in conjunction with the Wait (4) function to determine whether the host
application is ready for input. First wait for input enable, then search for the correct host panel
defining a key string with Search Presentation Space (6).

This function is case-sensitive. The string you look for must be an exact match.
The following Set Session Parameters (9) values affect this function:

SRCHALL/SRCHFROM

SCRCHFRWD/SRCHBKWD
Reflection for IBM HLLAPI Reference 123

WinHLLAPI Function

Query Cursor Location (7)

Description
The Query Cursor Location (7) function returns the cursor position in the currently connected
RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD QUERYCURSORLOC, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 7
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Parameter
Length: RIBM presentation space position of the cursor location.
Return Code

0 WHLLOK The function was successful.


1 WHLLNOTCONNECTED Your application program is not connected to an RIBM
presentation space.
9 WHLLSYSERROR System error.
124 Reflection for IBM HLLAPI Reference

Remarks
This function is useful in conjunction with the Wait (4) function to synchronize with the host
application panel appropriate for next input.

WinHLLAPI Function

Copy Presentation Space to String (8)

Description
The Copy Presentation Space (8) to String function copies the RIBM presentation space to a
string in your client application.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD COPYPSTOSTR, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 8
Data String Defined data string to hold the entire content of the RIBM presen-
tation space.
Since this function is copying from the RIBM presentation space to
a string, you must ensure that the buffer is large enough to hold the
data specified in the length parameter.
Length Length of the target data string to copy.
PS Position Position where the copying should begin.
Reflection for IBM HLLAPI Reference 125

Return Parameter
Data String Contents of the copied string from the RIBM presentation space.
Return Codes

0 WHLLOK The RIBM presentation space was copied to the pre-


allocated buffer in your client application program. The
keyboard is unlocked.
1 WHLLNOTCONNECTED Your application program is not connected to a valid
RIBM presentation space.
2 WHLLPARAMETERERROR The string length specified in your application is
incorrect.
4 WHLLPSBUSY The content was copied. The RIBM presentation space is
waiting for a host response.
5 WHLLINHIBITED The content was copied. The keyboard is locked.
7 WHLLPOSITIONERROR Your application program calculated an invalid RIBM
presentation space position.
9 WHLLSYSERROR System error.

Remarks
The upper left corner of the RIBM presentation space is defined as position 1 and the last
position is the maximum number of the presentation space.

The following Set Session Parameters (9) values affect this function:

ATTRB/NOATTRB

EAB/NOEAB

XLATE/NOXLATE
126 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Set Session Parameters (9)

Description
The Set Session Parameters function lets the WinHLLAPI client program specify default values
for several WinHLLAPI functions.

The values are divided into a number of sets which affect the WinHLLAPI functions.

Values are in effect until one of the following events occurs:

A new call to Set Session Parameters (9) defines a new value.

The session parameters are reset using Reset System (21) function.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD SETSESSIONPARAMETERS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 9
Data String A text string containing the session parameters. These parameter
can be contained in a list delimited by commas or spaces.
Length Length of source data string.
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 127

NOATTR/ATTR
Specifies whether to translate character attributes to ASCII values or not. This parameter
affects Copy Presentation Space (5), Copy Presentation Space to String (8), and Copy Field to
String (34) functions.

Parameter Description

ATTRB Keep original values in their original EBCDIC code. Attribute bytes
are also returned.
NOATTRB (default) Translates non-ASCII values to blanks (20H).

EAB/NOEAB
Specifies if a copy function should include extended attributes (EABs). These functions are
used with Copy Presentation Space (5) , Copy Presentation Space to String (8), Copy String to
Presentation Space (15), and Copy Field to String (34).

Parameter Description

EAB Data string includes extended attribute bytes (EABs), producing


two characters for each screen character. Allocate a buffer twice the
size of the RIBM presentation space.
NOEAB (default) EABs are not included in data string. Allocate the size of
the RIBM presentation space.

STREOT/STRLEN
Determines how the length of a data string is determined.

Parameter Description

EAB Data string includes extended attribute bytes (EABs), producing


two characters for each screen character. Allocate a buffer twice the
size of the RIBM presentation space.
NOEAB EABs are not included in data string. Allocate the size of the RIBM
presentation space (default).
128 Reflection for IBM HLLAPI Reference

EOT
The EOT character is used to define a EndOfText character in a data string. This function is
used in Send Key (3), Search Presentation Space (6), Copy String to Presentation Space (15),
Search Field (30), Copy String to Field (33), Send File (90) , and Receive File (91)

Parameter Description

EOT=char char is a character to specify the end of a data string. Binary 0 is the
default value. A blank is not accepted as EOT. This parameter is
used only if the STREOT option is used.

XLATE/NOXLATE
Specifies if EABs are translated to CGA format or not.

Parameter Description

XLATE (default) EABs are translated to CGA format.


NOXLATE Skips EAB translation.

CONLOG/CONPHYS
These parameters are ignored.
Esc Parameter
Specifies the Esc character. This parameter is used by Send Key (3) and Get Key (51).

Parameter Description

ESC=char Specifies the escape character for keystroke mnemonics (@ is


the default). Blank is not a valid escape value.

Reset Parameter
This parameter is used by Send Key (3) and Get Key (51).

Parameter Description

AUTORESET (default) Automatically sends Reset with strings with Send Key (3)
function to unlock the input inhibited condition that might exist.
NORESET Does not send a Reset in a data string.
Reflection for IBM HLLAPI Reference 129

SEARCHALL/SRCHFROM
Specifies how WinHLLAPI should search the RIBM presentation space. These parameters are
used with Search Presentation Space (6) and Search Field (30).

Parameter Description

SRCHALL Searches the entire RIBM presentation space or field (default).


SRCHFROM Searches from a specified beginning location of the RIBM
presentation space or field.

SEARCHFRWD/SRCHBKWD

Parameter Description

SCRCHFRWD Searches forward through the RIBM presentation space (default).


SRCHBKWD Searches backward through the RIBM presentation space.

TRON/TROFF
Specifies debug tracing. A file will be created in the TEMP directory (or windows directory if
the TEMP environment variable isn't set). The name of the file is Hll*.tmp, where the
wildcard segment is a random hex number between 0 and FFFFF. The file will be appended for
as long as that instance of the WinHLLAPI DLL is loaded in memory. Subsequent instances
will create
new files.

Trace Parameter Description

TRON Turns trace on.


TROFF (default) Turns trace off.
130 Reflection for IBM HLLAPI Reference

Wait Parameter
Specifies the characteristics of a wait period.

Parameter Description

TWAIT (default) For Wait (4), waits up to 60 seconds before timing out on
XCLOCK or XSYSTEM. For Get Key (51) TWAIT waits until a key is
in the buffer (normal or AID key based on Start Keystroke Intercept
(50) option, D or L )and then returns control to the client WinHLLAPI
program.
LWAIT For Wait (4), waits until XCLOCK/XSYSTEM clears on OIA. For Get
Key (51) LWAIT does not return control to your WinHLLAPI program
until it has intercepted a keystroke (normal or AID key based on Start
Keystroke Intercept (50) option, D or L ).
NWAIT No waiting period. For Wait (4) checks status and returns immediately
For Get Key (51) NWAIT checks status and returns error code 25
immediately, keystroke not available.

FPAUSE/IPAUSE
Specifies type of pause. This parameter is used by the Pause (18) function.

Parameter Description

FPAUSE Full pause. The HLLAPI client program can set the duration of the
pause in the Pause (18) function (default).
IPAUSE Interruptible pause; Start Host Notification (23) or any host system
event will end a pause.

NOQUIET/QUIET
Specifies whether the Send File (90) or Receive File (91) functions will send messages to the
RIBM presentation space and display them to the operator.

Parameter Description

NOQUIET Displays messages.


QUIET Does not display messages.
Reflection for IBM HLLAPI Reference 131

TIMEOUT
Specifies the number of 30-second cycles WinHLLAPI waits before terminating the file transfer
with Ctrl+Break. This parameter is used with the Send File (90) or Receive File (91) functions.

Parameter Description

TIMEOUT=0 A Ctrl+Break is issued after 30 seconds. Blanks are not allowed.


TIMEOUT=char Specifies the number of 30-second cycles to wait until WinHLLAPI
issues a Ctrl + Break and terminates the file transfer.
c=character which defines how many 30 second cycles are acceptable
before a Ctrl+Break is issued. No blanks are allowed.

Character Minutes Seconds


1 0.5 30
2 1.0 60
3 1.5 90
4 2.0 120
5 2.5 150
6 3.0 180
7 3.5 220
8 4.0 240
9 4.5 270
J 5.0 300
K 5.5 330
L 6.0 360
M 6.5 390
N 7.0 420
132 Reflection for IBM HLLAPI Reference

RESUME/NORESUME
Specifies how Connect Presentation Space (1) affects a DOS session.

Parameter Description

RESUME Resumes a DOS session while the host session is active.


NORESUME Suspends DOS session while the host session is active.

BLANK/NOBLANK
Specifies how Copy Presentation Space (5) and Copy Presentation Space to String affects
unknown values NOATTRIB and NOEAB are specified.

Parameter Description

BLANK Converts unknown values to X00.


NOBLANK Converts unknown values to X20.

NEWOIA/OLDOIA
Specifies in which format the Copy OIA (13) function returns its data.

Parameter Description

OLDOIA Data OIA is returned in 3270 PC format. The 5250 OIA


image is always returned in ASCII.
NEWOIA Data OIA is returned in ASCII format.

NEWRET / OLDRET
Specifies how the Query Cursor Location (7) function returns cursor position data.

Parameter Description

NEWRET Query Cursor Location (7) returns the cursor position in the
Length or Location parameter.
OLDRET Query Cursor Location (7) returns the cursor position in the
Return Code parameter.
Reflection for IBM HLLAPI Reference 133

Return Parameter

Length: Number of valid session parameters that were set.

Return Codes

0 WHLLOK Successful.
2 WHLLPARAMETERERROR One or more unrecognized parameter values; all
recognized values accepted.
9 WHLLSYSERROR System error.

WinHLLAPI Function

Query Sessions (10)

Description
The Query Sessions function returns a 12 byte long data string for each started RIBM presen-
tation space. The data string contains information about RIBM presentation space names and
size of RIBM presentation space. It also returns a data length parameter which holds the
number of active RIBM presentation spaces.
Prerequisites
None.
Function Calls
WORD WinHLLAPI(

LPWORD QUERYSESSIONS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
134 Reflection for IBM HLLAPI Reference

Call Parameters

Function Number 10
Data String Data string for session parameters.
Length 12 bytes * the number of started host RIBM presentation spaces.
Max size is 12 * 16 = 192.
PS Position Not applicable.

Return Parameter
Length The number of started host RIBM presentation spaces.

Each 12-byte string contains

1 RIBM presentation space short name.


2-9 RIBM presentation space long name.
10 H = host.
11-12 RIBM presentation space size. This is a number, such as 1920 for IBM mod 2.

Return Codes

0 WHLLOK Successful.
2 WHLLPARAMETERERROR Invalid string length.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 135

WinHLLAPI Function

Reserve (11)

Description
The Reserve function blocks an operator from entering any information on the RIBM presen-
tation space via the keyboard. You should use this function if you need total control of the
RIBM presentation space and need to prevent other input.
Prerequisite
Connect Presentation Space (1).
Function Call
WORD WinHLLAPI(

LPWORD RESERVE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 11
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Code

0 WHLLOK The Reserve function was successful.


1 WHLLNOTCONNECTED Your client application is not connected to a RIBM
presentation space.
9 WHLLSYSERROR System error.
136 Reflection for IBM HLLAPI Reference

Remarks
The Reserve (11) function is very useful when your application is sending a series of keystrokes
to a host panel, and you want to prevent the users from accessing the RIBM presentation space
until the transactions are completed.

Your WinHLLAPI application needs to unlock the RIBM presentation space with Release (12),
Disconnect Presentation Space (2), or Reset System (21) functions.

WinHLLAPI Function

Release (12)

Description
The Release function unlocks a RIBM presentation space that was locked using the Reserve
(11) function.
Prerequisite
Connect Presentation Space (1) and Reserve (10)
Function Call
WORD WinHLLAPI(

LPWORD RELEASE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 12
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 137

Return Codes

0 WHLLOK The Release function was successful.


1 WHLLNOTCONNECTED Your client application is not connected to an
RIBM presentation space.
9 WHLLSYSERROR System error.

Remarks
RIBM presentation space unlock also occurs automatically when the application program
disconnects from the reserved session with Disconnect Presentation Space (2), connects to
another session with Connect Presentation Space (1), or calls Reset System (21).

WinHLLAPI Function

Copy OIA (13)

Description
The Copy Operator Information Area function returns the contents of the operator infor-
mation area (OIA) from the currently connected RIBM presentation space. A 103-byte string
returns the data to your client WinHLLAPI application. The interpretation of the string is
different for a 3270 and a 5250 string.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD COPYOIA, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
138 Reflection for IBM HLLAPI Reference

Call Parameters

Function Number 13
Data String A 103 byte long data string, pre-allocated in
your application program.
Length 103 bytes.
PS Position Not applicable.

Return Parameters
Data String: Data string containing the contents of the identified OIA. The OIA data string
contains the following information:

Byte:

1 OIA Format Byte. This byte is always 1 for 3270, and 9 for 5250.
2 - 81 OIA Image Groups. These bytes contain hexadecimal codes of the OIA
image symbols.
82 - 103 The OIA group indicators. An ASCII character string, which can be trans-
lated into graphics characters.
Reflection for IBM HLLAPI Reference 139

OIA Image Symbols for 3270 Sessions

3270 OIA Group Indicators


Group 1: Online and screen ownership
1 byte (Data String position 82) applies to Data String position 2

Bits 0-1 Reserved


Bit 2 SSCP-LU session owns screen
Bit 3 LU-LU session owns screen
Bit 4 Online and not owned
Bit 5 Subsystem ready
Bits 6-7 Reserved
140 Reflection for IBM HLLAPI Reference

Group 2: Character selection


1 byte Data String position 83

Bit 0 Reserved
Bit 1 APL
Bit 2 Kana
Bit 3 Alpha
Bits 4-7 Reserved
Group 3: Shift state
1 byte Data String position 84

Bit 0 Upper shift


Bit 1 Numeric shift
Bits 2-7 Reserved
Group 4: Program Symbol Support group 1
1 byte Data String position 85 not used (reserved)
Group 5: Highlight group 1
1 byte Data String position 86

Bit 0 User-selectable
Bit 1 Field inherit
Bits 2-7 Reserved
Group 6: Color group 1
1 byte Data String position 87

Bit 0 User-selectable
Bit 1 Field inherit
Bits 2-7 Reserved
Group 7: Insert
1 byte Data String position 88

Bit 0 Insert mode


Bit 1-7 Reserved
Group 8: Input inhibited
5 bytes Data String positions 89-93
Reflection for IBM HLLAPI Reference 141

Byte 1 (Data String position 89)


Bit 0Non-resettable machine check
Bit 1Reserved
Bit 2Machine check
Bit 3Communications check
Bit 4Program check
Bit 5Reserved
Bit 6Device not working
Bit 7Reserved
Byte 2 (Data String position 90)
Bit 0OIA time
Bit 1Terminal wait
Bit 2Reserved
Bit 3Minus function
Bit 4Too much entered
Bits 5-7Reserved
Byte 3 (Data String position 91)
Bit 0Reserved
Bit 1User-unauthorized
Bit 2User-unauthorized, minus function
Bit 3Invalid dead key combination
Bit 4Wrong place
Bits 5-7Reserved
Byte 4 (Data String position 92)
Bits 0-1Reserved
Bit 2System wait
Bits 3-7Reserved
Byte 5 (Data String position 93)
Bits 0-7Reserved
142 Reflection for IBM HLLAPI Reference

Group 9: Program Symbol Support group 2


1 byte (Data String position 94) not used (reserved)
Group 10: Highlight group 2
1 byte (Data String position 95)

Bit 0 Selected
Bits 1-7 Reserved
Group 11: Color group 2
1 byte (Data String position 96)

Bit 0 Selected
Bits 1-7 Reserved
Group 12: Communication error
1 byte Data String position 97

Bit 0 Communications error


Bit 1-7 Reserved
Group 13: Printer status
1 byte (Data String position 98)

Bit 0 Reserved
Bit 1 Printer malfunction
Bit 2 Printer printing
Bit 3 Printer assignment
Bits 4-7 Reserved
Group 14: Graphics
1 byte Data String position 99 not used (reserved)
Group 15: Not used
1 byte Data String position 100 not used (reserved)
Group 16: Autokey play/record status
1 byte Data String position 101 not used (reserved)
Reflection for IBM HLLAPI Reference 143

Group 17: Autokey abort/pause status


1 byte Data String position 102 not used (reserved)
Group 18: Enlarge state
1 byte Data String position 103 not used (reserved)
OIA Image Symbols for 5250 Sessions
144 Reflection for IBM HLLAPI Reference

OIA Group Indicator Meanings for 5250 Sessions


Group 1: Online and screen ownership
1 byte Data String position 82

Bits 0-2 Reserved


Bit 3 System available
Bit 4 Reserved
Bit 5 Subsystem ready
Bits 6-7 Reserved
Group 2: Character selection
1 byte Data String position 83

Bits 0-4 Reserved


Bit 5 Diacritic mode
Bit 6-7 Reserved
Group 3: Shift state
1 byte Data String position 84

Bits 0 Reserved
Bit 1 Keyboard Shift
Bits 2-7 Reserved
Group 4: Program System Support group 1
1 byte Data String position 85 not used (reserved)
Group 5: Highlight group 1
1 byte Data String position 86 not used (reserved)
Group 6: Color group 1
1 byte Data String position 87 not used (reserved)
Group 7: Insert
1 byte Data String position 88

Bit 0 Insert mode


Bits 1-7 Reserved
Group 8: Input inhibited
5 bytes Data String positions 89-93
Reflection for IBM HLLAPI Reference 145

Byte 1 Data String position 89


Bit 0-7 Reserved
Byte 2 Data String position 90
Bit 0-7 Reserved
Byte 3 Data String position 91
Bits 0-4 Reserved
Bit 5 User input error (II)
Bits 3-7 Reserved
Byte 4 Data String position 92
Bits 0-1 Reserved
Bit 2 System wait
Bits 3-7 Reserved
Byte 5 Data String position 93
Bits 0-7 Reserved
Bit 5 User input error (II)
Bits 3-7 Reserved
Group 9: Program Symbol Support group 2
1 byte (Data String position 94) not used (reserved)
Group 10: Highlight group 2
1 byte (Data String position 95) not used (reserved)
Group 11: Color group 2
1 byte (Data String position 96) not used (reserved)
Group 12: Communication error reminder (97)
1 byte (Data String position 97)

Bit 0-6 Reserved


Bit 7 Message Waiting (MW)
Group 13: Printer status
1 byte Data String position 98 not used (reserved)
Group 14: Graphics
1 byte Data String position 99 not used (reserved)
146 Reflection for IBM HLLAPI Reference

Group 15: Not used


1 byte Data String position 100 not used (reserved)
Group 16: Autokey play/record status
1 byte Data String position 101 not used (reserved)
Group 17: Autokey abort/pause status
1 byte Data String position 102 not used (reserved)
Group 18: Enlarge state
1 byte Data String position 103 not used (reserved)
Return Codes

0 WHLLOK OIA copying is successful. RIBM presentation space is


unlocked for input.
1 WHLLNOTCONNECTED The HLLAPI application is not connected to a valid RIBM
presentation space.
2 WHLLPARAMETERERROR The HLLAPI application passed an invalid string length.
The OIA could not be copied.
4 WHLLPSBUSY The OIA was copied, but RIBM presentation space is busy.
5 WHLLINHIBITED The OIA was copied, RIBM presentation space is locked.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 147

WinHLLAPI Function

Query Field Attribute (14)

Description
The Query Field Attribute function is used to return a field attribute byte for a specific RIBM
presentation space position.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD QUERYFIELDATTRIBUTE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 14
Data String Not applicable.
Length Not applicable.
PS Position RIBM presentation space position.

Return Parameter
Length:

0 RIBM presentation space is unformatted. No attribute can be returned.


>0 If value is greater than zero, it returns the value of the field attribute on RIBM
presentation space.

Bit Position Meaning

0-1 Both =1, field attribute Byte


148 Reflection for IBM HLLAPI Reference

Bit Position Meaning

2 Unprotected/Protected
0 = Unprotected data field
1 = Protected field
3 A/N
0 = Alphanumeric data
1 = Numeric data only
4-5 I/SPD
00 = Normal intensity, pen not detectable
01 = Normal intensity, pen detectable
10 = High intensity, pen detectable
11 = Non-Display, pen not detectable
6 Reserved
7 MDT
0 = Field has not been modified
1 = Field has been modified

Return Codes

0 WHLLOK The Query Field Attribute was successful.


1 WHLLNOTCONNECTED The WinHLLAPI application is not connected to the
RIBM presentation space.
7 WHLLPOSITIONERROR RIBM presentation space position is invalid.

Remarks
This function is useful to determine the RIBM presentation space target field when you use the
following functions:

Copy String To Field (33)

Copy String To Presentation Space (15)

Find Field Length (32)


Find Field Position (31)

Send Key (3)


Reflection for IBM HLLAPI Reference 149

WinHLLAPI Function

Copy String to Presentation Space (15)

Description
The Copy String to Presentation Space (15) function copies an ASCII data string to a defined
position on the RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Function Calls
WORD WinHLLAPI(

LPWORD COPYSTRTOPS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 15
Data String A string of ASCII characters you want to copy into an
unformatted position on RIBM presentation space.
Length Contains the total length of the string to copy, including
EABs, if the EAB parameter is selected. This parameter is
ignored if you have selected the STREOT parameter using
Set Session Parameters (9).
PS Position RIBM presentation space position where copying begins.

Return Codes

0 WHLLOK The Copy String to Presentation space (15) function


was successful. The string was copied.
1 WHLLNOTCONNECTED Copy not configured or the client application does not
have a connection.
150 Reflection for IBM HLLAPI Reference

2 WHLLPARAMETERERROR Parameter error.


5 WHLLINHIBITED The RIBM presentation space is prohibited, field is
protected, or non-ASCII data was sent to the RIBM
presentation space.
6 WHLLTRUNCATED The function was successful, the string was copied, but
data is truncated at end of screen, or end of field.
7 WHLLPOSITIONERROR The RIBM presentation space position is invalid. Check
the size of the RIBM presentation space.
9 WHLLSYSERROR System error.

Remarks
The data string must be the same size or smaller than the size of the RIBM presentation space
buffer size or the size of the target area.

Non-ASCII characters in the data string are translated into blanks in the RIBM presentation
space.

If EABs are set, the input string should contain the appropriate EABs following each ASCII
character.

This function is also affected by the STRLEN/STREOT and EOT option, defined in Set Session
Parameters (9).

To send AID keys to RIBM presentation space, use the Send Key (3) function. For example, the
most efficient way to send a host command to the host session is to send the ASCII string with
the Copy String to Presentation Space (15) function and then send the Enter AID key with the
Send Key (3) function.

The cursor location will not be updated with the Copy String to Presentation Space (15)
function. To copy to the current cursor position, use the Query Cursor Location (7), and place
the returning parameter value in the presentation space position parameter when you call this
function.
Reflection for IBM HLLAPI Reference 151

WinHLLAPI Function

Pause (18)

Description
The Pause (18) function is used to add a pause to a host session sequence. The function halts for
a specified amount of time, or until a host event satisfies the pause.
Prerequisites
A Start Host Notification (23) function call is required if the IPAUSE parameter is selected using
Set Session Parameters (9).
Function Call
WORD WinHLLAPI(

LPWORD PAUSE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 18
Data String Not applicable.
Length Sets the duration of the pause.
This parameter must be an integer between 0 and 65535.
The pause is set in half-second increments. For example, 1
= 0.5 seconds, 60 = 30 seconds, 120 = 1 minute (60
seconds), etc.
PS Position Not applicable.
152 Reflection for IBM HLLAPI Reference

Return Code

0 WHLLOK Pause duration has expired.


9 WHLLSYSERROR System error.
26 WHLLPSCHANGED RIBM presentation space or OIA has been updated.

Use Query Host Update (24) for more information.


Remarks
An event happens when either the RIBM presentation space, or OIA is updated during a
session. If you need to terminate the pause for this type of event, you can select the IPAUSE
parameter in Set Session Parameters (9). Only then will the Pause function terminate.

If your client application is not connected to a RIBM presentation space the pause will wait the
full duration, disregarding the pause parameter. If the IPAUSE parameter is selected using Set
Session Parameters (9), the pause queue needs to clear before next function call. To reset the
pause queue prior to the next Pause (18) function call, you must call the Query Host Update
(24) function.

The Pause (18) function is not a sufficient method to pause if you need to wait for long periods
of time. Do not use the Pause (18) function if your application needs to pause longer than 20
minutes. The Pause (18) function is not an exact timekeeper, and should not be used for
applications that require precise timing.

The following Set Session Parameters (9) values affect this function:

FPAUSE/IPAUSE
Reflection for IBM HLLAPI Reference 153

WinHLLAPI Function

Query System (20)

Description
The Query System (20) function lets your WinHLLAPI application determine settings and other
values related to the system. The function returns a 35-byte long string with WinHLLAPI related
information such as version number, level number, date, etc.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD QUERYSYSTEM, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 20
Data String A 35-byte data string. The return parameter contains the
system information.
Length Not applicable (35 is implied).
PS Position Not applicable.

Return Parameter
This function returns a 35 byte long string with system information.
154 Reflection for IBM HLLAPI Reference

Data String
Bytes

1 WinHLLAPI version number.

2-3 WinHLLAPI level number.

4-9 WinHLLAPI version date (mmddyy).


10-12 Not applicable.

13 Hardware Base (always U).

14-35 Not applicable.


Return Codes

0 WHLLOK The Query System function was successful.


1 WHLLNOTCONNECTED WinHLLAPI not connected to RIBM presentation
space.
2 WHLLPARAMETERERROR Parameter error, Invalid string length. You must
allocate a 35-byte string to receive the returning data
string parameter.
9 WHLLSYSERROR System error.

Remarks
You must allocate a 35-byte string to receive the returning data string parameter. Depending
on which WinHLLAPI system you are querying, you will get different return bytes in the return
parameter. Refer to other WinHLLAPI suppliers for documentation regarding their return
parameters.
Reflection for IBM HLLAPI Reference 155

WinHLLAPI Function

Reset System (21)

Description
The Reset System (21) function reinitializes the WinHLLAPI to its starting state. This function
can also be used to ensure that WinHLLAPI is loaded.

You can use this function when you start or terminate your WinHLLAPI program.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD RESETSYSTEM, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 21
Data String Not applicable.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 WHLLOK The Reset function was successful.


1 WHLLNOTCONNECTED WinHLLAPI not loaded. This return code is useful to
insure that WinHLLAPI is loaded.
9 WHLLSYSERROR System errors.
156 Reflection for IBM HLLAPI Reference

Remarks
The system resets the following:

Reinitializes WinHLLAPI to the starting state.

Default values are restored in Set Session Parameters (9)

Unlocks keyboard and stops keyboard intercept, if started


Stops host notification, if started.

Stops close intercept, if started.

Disconnects the client application from connected RIBM presentation space.

Releases host sessions.

Cancels error messages.

Stops all Async notifications.

In the beginning of an application you can restore values with Reset (21) and ensure that
WinHLLAPI is loaded. If WinHLLAPI is not loaded, a return code 1 WHLLNOTCON-
NECTED will be returned.

Reset System (21) should be used very sparingly, i.e. during startup only; to restore any
changed session parameters, use Set Session Parameters (9) to change them instead.
Reflection for IBM HLLAPI Reference 157

WinHLLAPI Function

Query Session Status (22)

Description
The Query Session Status (22) function returns information about a RIBM presentation space.
The function returns the status information in an 18-byte data string.

The following information is included in the return parameter of Query Session Status (22).

RIBM presentation space names

Session type

EAB and presentation space information

Session usage

RIBM presentation space row/column information

Host code number


Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD QUERYSESSIONSTATUS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 22
Data String 18 bytes. The first byte must be either:
a letter A-Z, which indicates the RIBM presentation
space short name.
a (space) which indicates the currently connected
RIBM presentation space.
158 Reflection for IBM HLLAPI Reference

Length 18 bytes.
PS Position Not applicable.

Return Parameter
Data String:

1 RIBM presentation space short name.

2-9 RIBM presentation space long name.

10 RIBM presentation space type information.

How this is implemented:

D = 3270 Host.
F = 5250 Host.

11 RIBM presentation space Characteristics

Bit 0: 0 = No EABs.
1 = EABs are on.

1-7: Not used.

12 - 13 Binary value. Number of RIBM presentation space rows.

14 - 15 Binary value. Number of RIBM presentation space columns.

16 - 18 Not applicable.
Return Codes

0 WHLLOK Query Session Status function was successful.


1WHLLNOTCONNECTED Invalid RIBM presentation space short name .
2 WHLLPARAMETERERROR Invalid string parameter length. Length must be set to 18.
9 WHLLSYSERROR System error.

Remarks
The values for Rows and Columns returned in byte 12-15 correspond to the RIBM presentation
space buffer size depending on the model.
Reflection for IBM HLLAPI Reference 159

WinHLLAPI Function

Start Host Notification (23)

Description
The Start Host Notification (23) function starts monitoring the RIBM presentation space or
operator information area for updates. Following this call, your application must call the Query
Host Update (24) function to check when the host updated the RIBM presentation space or OIA.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

STARTHOSTNOTIFICATION, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,STARTHOSTNOTIFICATION,lpbyString,lpwLength,lpwReturnCode)
Call Parameters

Function Number 23
Data String A six-byte long string.
1 RIBM presentation space short name, or blank or null (request
against the currently connected RIBM presentation space).
2 One of the following characters:
B = Both. Notification of OIA and presentation space updates.
O = Notification of any OIA updates.
P = Notification of any RIBM presentation space updates.
3-6 Ignored by WinHLLAPI.
Length 6
PS Position Not applicable.
160 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK The Start Host function was successful.


1 WHLLNOTCONNECTED Invalid RIBM presentation space ID.
2 WHLLPARAMETERERROR Invalid parameters.
9 WHLLSYSERROR System error.

Asynchronous Mode
Start Host Notification (23) can also be called asynchronously using WinHLLAPIAsync. If
successful, a client is notified of any subsequent host updates by windows messages which
must be registered using RegisterWindowsMessage( ) with WinHLLAPIAsync. Please see
WinHLLAPIAsync for details.
Remarks
The Copy OIA (13) function is a superior way of ensuring that the host has completed
processing and that the RIBM presentation space is ready for input. To be sure the correct
host panel is displayed, call Search Presentation Space (6) and search for a keyword within the
panel.
Reflection for IBM HLLAPI Reference 161

WinHLLAPI Function

Query Host Update (24)

Description
The Query Host Update (24) function allows your application to determine if the host has
updated the RIBM presentation space, or operator information area (OIA) since:

Start Host Notification (23)

Previous Query Host Update (24) function was called.

The queried RIBM presentation space must be specified in the data string, but your EHLLPI
application program does not need to be connected to current the RIBM presentation space
for updates.
Prerequisites
Your application must call the Start Host Notification (23) function before calling this
function.
Function Call
WORD WinHLLAPI(

LPWORD QUERYHOSTUPDATE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 24
Data String One character A-Z short name for the RIBM presentation space. A
space indicates a request for updates to the requested RIBM presen-
tation space.
Length Not applicable (1 is implied).
PS Position Not applicable.
162 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK No updates have been made since last function call.


1 WHLLANOTCONNECTED Invalid RIBM presentation space short name.
8 WHLLNOTAVAILABLE Your application needs to call Start Host Notification
(23).
9 WHLLSYSERROR System error.
21 WHLLOIAUPDATE The OIA was updated.
22 WHLLPSUPDATE The RIBM presentation space was updated.
23 WHLLBOTHUPDATE Both OIA and RIBM presentation space were
updated.

Remarks
To disable the Query Host Update (24) function, and stop monitoring updates, you must call
the Stop Host Notification (25) function.

The Stop Host Notification (25) function ends the Query Host Update function (24).
Reflection for IBM HLLAPI Reference 163

WinHLLAPI Function

Stop Host Notification (25)

Description
The Stop Host Notification (25) function disables the capability of the Query Host Update (24)
function to determine if the host RIBM presentation space or OIA has been updated. This
function can also be used to stop host events from affecting the Pause function.
Prerequisites
Start Host Notification (23)
Function Call
WORD WinHLLAPI(

LPWORD STOPHOSTNOTIFICATION, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 25
Data String Short name of the RIBM presentation space or blank or null
indicating a request for the current RIBM presentation space.
Length Not applicable (1 is implied).
PS Position Not applicable.

Return Codes

0 WHLLOK Stop Host Notification was successful.


1 WHLLANOTCONNECTED Invalid RIBM presentation space short name.
8 WHLLNOTAVAILABLE No Start Notification was issued.
9 WHLLSYSERROR System error.

Asynchronous Mode
This function will also stop any asynchronous host updates, i.e. stop sending messages, which
had been started using WinHLLAPIAsync.
164 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Search Field (30)

Description
The Search Field (30) function searches for a text string in protected or unprotected fields of
the RIBM presentation space. When the specified text string is found, the function returns the
RIBM presentation space position.

This function is case-sensitive and requires an exact match of the text string parameter and the
RIBM presentation space content.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD SEARCHFIELD, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 30
Data String Text string to search presentation. End the string with EOT if the client
uses STREOT. See Set Session Parameters (9).
Length Specifies the length of the string you are searching. Not applicable if
EOT is used to end the string.
PS Position Specifies the beginning RIBM presentation space position to search
from. If SRCHFROM is set, it also specifies the position within the field.
Reflection for IBM HLLAPI Reference 165

Return Parameters
Length:

0 String was not found. The returning length is set to 0.


>0 If the returning length is greater (>) than 0, the returning length is the
starting RIBM presentation space position where the string was found.

Return Codes

0 WHLLOK The Search Field (30) function was successful.


1 WHLLNOTCONNECTED Invalid RIBM presentation space position.
2 WHLLPARAMETERERROR Parameter error. String length set to zero or did not
found a EOT character in the calling data string.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD String not found.

Asynchronous Mode
This function is not supported in asynchronous mode
Remarks
The following Set Session Parameters (9) values affect this function:
Search Parameters
SRCHALL/SRCHFROM

SCRCHFRWD/SRCHBKWD
166 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Find Field Position (31)

Description
The Find Field Position (31) function returns the position of a target field at the currently
connected RIBM presentation space. This function is useful for searching for either protected
or unprotected fields in a field formatted RIBM presentation space.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD FINDFIELDPOSITION, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 31
Data String Defines the field type.
[space] [space] This field ( )
T[space] This field ("T ")
N[space] Next field ("N ") either protected or unprotected
P[space] Previous field (P ) either protected or unprotected
NP Next protected field ("NP")
NU Next unprotected field ("NU")
PP Previous protected field ("PP")
PU Previous unprotected field ("PU")
Length Not applicable (2 is implied).
PS Position Contains the RIBM presentation space position in a field where the
function starts the search.
Reflection for IBM HLLAPI Reference 167

Return Parameters
Length:

0 If return code 28: No such field found. If return code 24: unformatted
host RIBM presentation space.
>0 The returning length is the starting RIBM presentation space position
where the field was found, defined as the first position after the
attribute byte.

Return Codes

0 WHLLOK The Find Field Position (31) function was successful.


1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD No such field or RIBM presentation space not formatted.
28 WHLLZEROLENFIELD Field length = 0.

Remarks
Query Field Attribute (14) returns the field attribute bytes value, and it can also detect an
unformatted RIBM presentation space. If the return parameter length is 0, the RIBM presen-
tation space is unformatted.
168 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Find Field Length (32)

Description
The Find Field Length (32) function searches the RIBM presentation space for a protected or
unprotected field and returns the field length.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD FINDFIELDLENGTH, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 32
Data String Specifies which field you want to search.
[space] [space] This field ( )
T[space] This field (T )
N[space] Next field (N ) either protected or unprotected
P[space] Previous field (P ) either protected or unprotected
NP Next protected field (NP)
NU Next unprotected field (NU)
PP Previous protected field (PP)
PU Previous unprotected field (PU)
Length Not applicable (2 is implied).
PS Position Contains the presentation space position where you want to start
the search.
Reflection for IBM HLLAPI Reference 169

Return Parameters
Length:

0 If return code 28: No such field found. If return code 24: unformatted host
RIBM presentation space.
>0 Length of the field.

Return Codes

0 WHLLOK The Find Field Length (32) function was successful.


1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD No such field.
28 WHLLZEROLENFIELD Field length = 0

Remarks
The Find Length (32) function returns the number of characters in the requested field in
the RIBM presentation space. The characters are calculated from the start of the target field
including the character before the next attribute byte.

The Find Length (32) function does not wrap, so if a field extends from the end to the beginning
of the RIBM presentation space, this function returns the length from the field origin to the end
of the RIBM presentation space.

If the field attribute is at the end of the RIBM presentation space, the field is assumed to have a
length of zero.

If two field attributes are positioned together, the field length in between them is assumed to
be zero.
Query Field Attribute (14) is useful for finding the current modified or protected field.
170 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Copy String to Field (33)

Description
The Copy String to Field (33) function copies a string of characters, defined in your client
application, into a specific unprotected field in the RIBM presentation space. It can only be
used in a field-formatted RIBM presentation space with unprotected fields.
Prerequisite
Connect Presentation Space (1).
Function Call
WORD WinHLLAPI(

LPWORD COPYSTRINGTOFIELD, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 33
Data String String of data in your application program you want to copy to
the RIBM presentation space. End string with EOT if STREOT is
specified. See Set Session Parameters (9).
Length Length of data. Applicable only if STRLEN is used.
PS Position Position on RIBM presentation space where the string will be
copied. The function transfers the string and places it in the
beginning of the unprotected field.

Return Codes

0 WHLLOK The Copy String to Field (33) was successful, the


string was copied.
1 WHLLNOTCONNECTED Not connected to RIBM presentation space.
Reflection for IBM HLLAPI Reference 171

2 WHLLPARAMETERERROR Parameter error.


5 WHLLINHIBITED The RIBM presentation space field was protected
or locked or non-ASCII characters was sent to the
field.
6 WHLLTRUNCATED Copied; data truncated. The field may be shorter
than the copied string.
7 WHLLPOSITIONERROR invalid RIBM presentation space position.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD Unformatted host RIBM presentation space.

Remarks
The copy operation ends when one of the following conditions is met:

End of source string, as defined in the Length parameter

End of field (EOF) in RIBM presentation space

End of RIBM presentation space

EOT is detected, if selected

Note that the Copy String to Field (33) function cannot copy non-ASCII characters or AID keys
to a field. Your application must use the Send Key (3) function to supply AID keys to a RIBM
presentation space.
172 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Copy Field to String (34)

Description
The Copy Field to String (34) function copies ASCII characters from a protected or unpro-
tected field in the RIBM presentation space to a string defined in your application. The RIBM
presentation space must be field-formatted.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD COPYFIELDTOSTRING, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 34
Data String String to which the program copies the contents of the field.
Length Length of the field. If the field contains EABs, then the length
must be twice the length of the field.
PS Position Any position within the field of the RIBM presentation space.
The copying will always start from the beginning of the field.

Return Parameter
Data String: This string contains the data that was copied from the field. The first byte of the
returned string contains the start byte of the field in the RIBM presentation space. The length
of this string is either the number of bytes in the specified field, or the number of bytes
specified
in the Length parameter. If the Length parameter is shorter than the actual string, the function
returns an error code (6), and the string is truncated.
Reflection for IBM HLLAPI Reference 173

Return Codes

0 WHLLOK The Copy Field to String (34) function was successful.


1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
6 WHLLTRUNCATED Data string and field lengths are not equal size. Data is
truncated.
7 WHLLPOSITIONERROR Invalid RIBM presentation space.
9 WHLLSYSERROR System error.
24 WHLLNOFIELD Unformatted RIBM presentation space.

Remarks
You can specify a presentation space Position anywhere within the field; the copy operation
starts from the beginning of a protected or unprotected field. If your application specifies a
position in the middle of a field the function copies the string from the beginning of that field.

Copy Field To String (34) transfers the string from the beginning of the field to the length
specified in the Length parameter.

Use Find Field Position (31) to find the fields position on the RIBM presentation space and Find
Field Length (32) to calculate the fields length, and then use the return parameters for these
functions in the Data String and Length parameters.

The copy operation ends when one of the following conditions is met:

End of field is reached

End of target buffer length is reached


End of RIBM presentation space is reached

This function is affected by the Set Session Parameters (9) functions:

ATTRB/NOATTRB

EAB/NOEAB

XLATE/NOXLATE

The Copy Field to String (34) function usually translates characters into ASCII, attributes are
translated to blanks.
174 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Display Cursor (37)

Description
The Display Cursor (37) function displays the cursor at a specified location in the RIBM presen-
tation space.
Prerequisite
None.
Function Call
WORD WinHLLAPI(

LPWORD DISPLAYCURSOR, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 37
Data String Presentation space short name.
Length Not applicable.
PS Position Desired cursor position in the RIBM presentation space.

Return Codes

0 WHLLOK The Display Cursor (37) function displayed the cursor


successfully at the specified position.
1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
4 WHLLPSBUSY RIBM presentation space is busy.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position. The cursor
location was outside the boundaries of the RIBM presen-
tation space.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 175

Remarks
The difference between Set Cursor (40) and Display Cursor (37) is that Display Cursor (37)
also takes Data String parameter where a short name is specified, and it does not have
Connect Presentation Space (1) as a prerequisite, Set Cursor (40), however, does not need the
short name but you must call Connect Presentation Space (1) to execute it.

WinHLLAPI Function

Set Cursor (40)

Description
The Set Cursor (40) function puts the cursor at a desired location in the RIBM presentation
space.
Prerequisite
Connect Presentation Space (1)
Function Call
WORD WinHLLAPI(

LPWORD SETCURSOR, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 40
Data String Not applicable.
Length Not applicable.
PS Position Desired cursor position in the RIBM presentation space.
176 Reflection for IBM HLLAPI Reference

Return Codes

0 WHLLOK The Set Cursor (40) function positioned the cursor


successfully at the specified position.
1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
4 WHLLPSBUSY RIBM presentation space is busy.
7 WHLLPOSITIONERROR Invalid RIBM presentation space position. The cursor
location was outside the boundaries of the RIBM presen-
tation space.
9 WHLLSYSERROR System error.

WinHLLAPI Function

Start Close Intercept (41)

Description
The Start Close Intercept (41) function intercepts a close request, when the user selects the close
option from the emulator.

To disable this function you must call Stop Close Intercept.


Prerequisite
None.
Function Call

WORD WinHLLAPI(
LPWORD STARTCLOSEINTERCEPT, // Pointer to function number
LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,STARTCLOSEINTERCEPT,lpbyString, lpwLength,lpwReturnCode)
Reflection for IBM HLLAPI Reference 177

Call Parameters

Function Number 41
Data String a letter A-Z, which indicates the RIBM presentation space short
name.
a (space) which indicates the currently connected RIBM
presentation space.
Length 1
PS Position Not applicable.

Return Codes

0 WHLLOK The Start Close Intercept (41) function was successful.


1 WHLLNOTCONNECTED Invalid host RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
9 WHLLSYSERROR System error.

Asynchronous Mode
Start Close Intercept (41) can also be called asynchronously using WinHLLAPIAsync. If
successful, a client is notified of any subsequent host updates by windows messages which
must be registered using RegisterWindowsMessage( ) with WinHLLAPIAsync.
Remarks
Reset system will remove the close intercept.
178 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Query Close Intercept (42)

Description
The Query Close Intercept (42) function returns a code that determines that the user tried to
close the application.
Prerequisite
Start Close Intercept (41)
Function Call
WORD WinHLLAPI(

LPWORD QUERYCLOSEINTERCEPT, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 42
Data String a letter A-Z, which indicates the RIBM presentation space
short name.
a (space) which indicates the currently connected RIBM
presentation space.
Length 1
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 179

Return Codes

0 WHLLOK A close event did not occur. The Query Close


Intercept (42) function was successful.
1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
8 WHLLNOTAVAILABLE Unavailable operation. Your application did
not call Start Close Intercept (41).
9 WHLLSYSERROR System error.
26 WHLLPSCHANGED A close intercept has occurred

WinHLLAPI Function

Stop Close Intercept (43)

Description
The Stop Close Intercept (43) function turns off the Start Close Intercept (41) function and the
user can use the close function.
Prerequisite
Start Close Intercept (41)
Function Call
WORD WinHLLAPI(

LPWORD STOPCLOSEINTERCEPT, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
180 Reflection for IBM HLLAPI Reference

Call Parameters

Function Number 43
Data String a letter A-Z, which indicates the RIBM
presentation space short name.
a (space) which indicates the currently
connected RIBM presentation space.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 WHLLOK The Stop Close Intercept (43) function was successful.


1 WHLLNOTCONNECTED Not connected to a RIBM presentation space.
2 WHLLPARAMETERERROR Parameter error.
8 WHLLNOTAVAILABLE Unavailable operation. Your application did not call Start
Close Intercept (41).
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 181

WinHLLAPI Function

Start Keystroke Intercept (50)

Description
The Start Keystroke Intercept (50) function starts a process with a set of four functions that
can capture and filter keystrokes entered by a terminal operator. The intercepted keystrokes
may be received through Get Key (51), accepted, or rejected by sending a beep message with
the Post Intercept Status. A keystroke can then be replaced with another keystroke using the
Send Key (3) function. Your application can stop and disable the process by calling Stop
Keystroke Intercept (53).
Prerequisite
None.
Function Call
WORD WinHLLAPI(

LPWORD STARTKSINTERCEPT, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,STARTKSINTERCEPT,lpbyString,lpwLength,lpwReturnCode)
Call Parameter

Function Number 50
Data String
1 a letter A-Z, indicating the HLLAPI short name.
a (space) which indicates the currently connected
RIBM presentation space.
2 Option code character.
182 Reflection for IBM HLLAPI Reference

D intercept AID keystrokes only, non-AID keys will be


sent to the RIBM presentation space and only the AID
keys will be captured by the application.
L Intercept all keystrokes.
3-6 Ignored by WinHLLAPI.
Length Recommended length of buffer: 256.
PS Position Not applicable.

Return Codes

0 WHLLOK The Start Keystroke Intercept (50) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space.
2 WHLLPARAMETERERROR Invalid character option specified. Only D or L is
accepted.
4 WHLLPSBUSY Presentation space was busy.
9 WHLLSYSERROR System error.

Asynchronous Mode
Start Keystroke Intercept (50) can also be called asynchronously using WinHLLAPIAsync. If
successful, a client is notified of any subsequent host updates by windows messages which
must be registered using RegisterWindowsMessage( ) with WinHLLAPIAsync. Please see
WinHLLAPIAsync for details.
Remarks
Your application can intercept keystrokes for more than one RIBM presentation space at a time.
If you need to use Send Key (3) to send keystrokes to intercepted RIBM presentation space, the
WinHLLAPI requires a call to Connect Presentation Space (1).

Start Keystroke Intercept (50) ends if one of the following occurs:

The application calls the Reset System (21) function.

The application calls the Stop Keystroke Intercept (53) function.


The application terminates.

The keyboard buffer overflows, see Get Key (51).


Reflection for IBM HLLAPI Reference 183

WinHLLAPI Function

Get Key (51)

Description
The Get Key (51) function allows your application to receive the AID keystrokes or all keystrokes
for the sessions that were specified with Start Keystroke Intercept (50).
Prerequisites
Prior call to Start Keystroke Intercept (50).
Function Call
WORD WinHLLAPI(

LPWORD GETKEY, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameter

Function Number 51
Data String String containing 8 bytes.
1 a letter A-Z, indicating the RIBM presentation space
short name.
a (space) which indicates the currently connected
RIBM presentation space.
2-8 Spaces to receive data in the return parameter.
Length 8 characters.
PS Position Not applicable.

Return Parameters

Data String String containing 8 bytes.


1 a letter A-Z, indicating the RIBM presentation space short
name.
a (space) which indicates the currently connected
RIBM presentation space.
184 Reflection for IBM HLLAPI Reference

2 Code character, one of the following:


A = ASCII returned.
M = Keystroke mnemonics.
S = Special shift (Alt/Ctrl).
Bytes 3 - 8 Six bytes allocated keystroke buffer to internally queue inter-
cepted keys. This buffer may contain one of the following:
Byte 3 = ASCII character and
byte 4 = X00. (The function returned a character key).
Byte 3 = ESC character (either @ or ESC character specified in
Set Session Parameters (9))
byte 4 = Keystroke mnemonics.
Bytes 5 through 8 may be similar to bytes 3 and 5 if the
returned keystroke mnemonic is longer than 2 bytes. See
Remarks.

Return Codes

0 WHLLOK The Get Key (51) function was successful.


1 WHLLNOTCONNECTED Invalid RIBM presentation space.
5 WHLLINHIBITED You specified D: (AID keystrokes only) in Start
Keystroke intercept (50). Non-AID keys are inhibited
by this session type.
8 WHLLNOTAVAILABLE Your application must call Start Keystroke Intercept
(50) before using Get Key (51).
9 WHLLSYSERROR System error.
20 WHLLUNDEFINEDKEY Undefined key combination was typed.
25 WHLLNOKEYSTROKES Keystrokes not available.
31 WHLLKEYOVERFLOW Queue overflow; keystrokes were lost. See Remarks
for more information about this error code.
Reflection for IBM HLLAPI Reference 185

Remarks
When a keyboard queue overflow resulting in an error code (31) occurs, you may increase the
value of the calling length parameter for Start Keystroke Intercept (50), or call the Get Key (51)
function repeatedly to eliminate the error.

If LWAIT has been specified, Get Key (51) will not return control to the application until there
are keystrokes in the buffer.

The following Set Session Parameters (9) values affect this function:

TWAIT/LWAIT/NWAIT
ESC=char

The return parameter contains a RIBM presentation space short name identification, a code
character, and an allocated buffer used for keystroke buffer queues. Below are some examples
and a breakdown of this buffer:

DAc:

D RIBM presentation space short name

A keystrokes will be received as ASCII

c returning key lower case

AM@4:

A RIBM presentation space short name

M keystrokes will be returned as key mnemonics


@4 key returned is PF4

ES@A@2:

E the RIBM presentation space short name

S keystrokes will be returned in a special shift state

@A@2 keys returned are Alt + PF2


186 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Post Intercept Status (52)

Description
The Post Intercept Status (52) function analyzes a keystroke and either accepts or rejects it.

If the function rejects the keystroke through Get Key (51), it sounds a beep.
Prerequisite
Start Keystroke Intercept (50).
Function Call
WORD WinHLLAPI(

LPWORD POSTINTERCEPTSTATUS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 52
Data String 2-byte data string.
1 One of the following:
a letter A-Z, which indicates RIBM presentation
space short name.
a (space) which indicates for the currently
connected RIBM presentation space.
2 A = Accepted keystroke.
R = Rejected keystroke (beep).
Length Not applicable (2 is implied).
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 187

Return Codes

0 WHLLOK The Post Intercept Status (52) function was successful.


1 WHLLNOTCONNECTED Invalid RIBM presentation space.
2 WHLLPARAMETERERROR Invalid RIBM presentation space option.
8 WHLLNOTAVAILABLE Start Keystroke Intercept (50) was not started for this
RIBM presentation space short name.
9 WHLLSYSERROR System error.

WinHLLAPI Function

Stop Keystroke Intercept (53)

Description
The Stop Keystroke Intercept (53) function ends the ability to intercept keystrokes in the RIBM
presentation space. When the function is successful, the terminal operator keystrokes return to
normal, and no keystrokes will be intercepted.
Prerequisite
Start Keystroke Intercept (50).
Function Call
WORD WinHLLAPI(

LPWORD STOPKSINTERCEPT, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
188 Reflection for IBM HLLAPI Reference

Call Parameters

Function Number 53
Data String One of the following:
a letter A-Z, which indicates presentation short name.
a (space) which indicates for the currently
connected RIBM presentation space.
Length Not applicable (1 is implied).
PS Position Not applicable.

Return Codes

0 WHLLOK The Stop Keystroke Intercept (53) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space.
2 WHLLPARAMETERERROR Invalid option.
8 WHLLNOTAVAILABLE Start Keystroke Intercept (50) was not started for this
RIBM presentation space short name.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 189

WinHLLAPI Function

Send File (90)

Description
The Send File (90) function transfers a file from your PC to the host RIBM presentation space
using the ind$file host file transfer function.
Prerequisite
None.
Function Call
WORD WinHLLAPI(

LPWORD SENDFILE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,SENDFILE,lpbyString,lpwLength,lpwReturnCode)
Call Parameters

Function Number 90
Data String Send command string. Maximum 128 bytes. Click here for a
complete description of the data string syntax for VM/CMS
systems or here for VMS/TSO systems.
Length Length of parameters string, or EOT if EOT mode is selected.
PS Position Not applicable.
190 Reflection for IBM HLLAPI Reference

Return Code

2 WHLLPARAMETERROR Parameter error.


3 WHLLFTXCOMPLETE File transfer complete.
4 WHLLFTXSEGMENTED File transfer complete, records segmented.
9 WHLLSYSERROR System error.
302 WHLLFILENOTFOUND File not found.
305 WHLLACCESSDENIED Access denied.
308 WHLLMEMORY Insufficient memory.

Asynchronous Mode
1. In this mode, the session initiates a file Xfr and immediately returns control to the calling
application.

2. The calling application should not issue any more WinHLLAPI calls while the file Xfr is in
progress.

3. Use RegisterWindowMessage() with WinHLLAPIAsyncFileTransfer to get the progress


of file transfer.

The message notification in format:

wMesageID: Message ID returned by RegisterWIndowMessage()


wParam: Status indicator where the high byte contains the session ID and the
low byte contains the status.
lParam: If the low byte of wParam is zero(transfer in progress), lParam is the
number of Bytes transferred. If the low byte is one (transfer
completed), lParam is the transfer completion code, i.e. the same
return code you would expect with synchronous file transfers.
Reflection for IBM HLLAPI Reference 191

Remarks
You can send a file to CMS, TSO, and CICS systems. Send File (90) does not support AS/400
file transfers.

Send File is not supported on AS/400.

The target host RIBM presentation space must be ready to receive the file, which means that
you should be logged on to the host computer, have the keyboard enabled, have no other file
transfer running at the same time to the same RIBM presentation space, and have the system
prompt displayed.

The following Set Session Parameters (9) values affect this function:
QUIET/NOQUIET

STRLEN/STREOT

TIMEOUT=c/TIMEOUT=0

EOT=c
192 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Receive File (91)

Description
The Receive File (91) function transfers a file from the host RIBM presentation space to the PC
using the ind$file host file transfer function.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD RECEIVEFILE, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

WinHLLAPIAsync(hWnd,RECEIVEFILE,lpbyString,lpwLength,lpwReturnCode)
Call Parameters

Function Number 91
Data String Receive command string. Maximum 128 bytes. Click here for
a complete description of the data string syntax for VM/CMS
systems or here for VMS/TSO systems.
Length Length of parameters string, or EOT if EOT mode is selected.
PS Position Not applicable.

Return Codes

2 WHLLPARAMETERROR Parameter error.


3 WHLLFTXCOMPLETE File transfer complete.
4 WHLLFTXSEGMENTED File transfer complete, records segmented.
9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 193

302 WHLLFILENOTFOUND File not found.


305 WHLLACCESSDENIED Access denied.
308 WHLLMEMORY Insufficient memory.

Asynchronous Mode
1. In this mode, the session initiates a file Xfr and immediately returns control to the calling
application.

2. The calling application should not issue any more WinHLLAPI calls while the file Xfr is in
progress.

3. Use RegisterWindowMessage() with WinHLLAPIAsyncFileTransfer to get the progress


of file transfer

The message notification in format:

wMesageID: Message ID returned by RegisterWIndowMessage().


wParam: Status indicator where the high byte contains the session ID and the low
byte contains the status.
lParam: If the low byte of wParam is two (transfer in progress), lParam is the
number of Bytes transferred. If the low byte is three (transfer completed),
lParam is the transfer completion code, i.e. the same return code you
would expect with synchronous file transfers.
194 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Convert (99)

Description
The Convert (99) function converts a position on the RIBM presentation space to a display
row/column coordinate, or a display row/column coordinate to a RIBM presentation space
position.
Prerequisites
None.
Function Call
WORD WinHLLAPI(

LPWORD CONVERT, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 99
Data String 2-byte data string.
1 One of the following:
a letter A-Z, which indicates presentation short name.
a (space) which indicates for the currently connected RIBM
presentation space.
2 P or R:
P = converts from Position to Row/Column.
R = converts from Row/Column to Position. See Length and presen-
tation space Position parameter below.
Length Row number on the RIBM presentation space. Valid row value is
between 1 and the maximum number of rows depending the model.
Not applicable when P is specified in the String parameter.
Reflection for IBM HLLAPI Reference 195

PS Position When R is specified, column number on RIBM presentation space.


Valid column value is between 1 and the max presentation space
position, usually 1920.
When P is specified, the RIBM presentation space position. A valid
value must be between 1 and maximum presentation space buffer size.

Return Parameters
The Convert (99) function does not return parameters.
Return Codes

0 Incorrect RIBM presentation space position or column.


>0 The converted RIBM presentation space position or column.

9998 WHLLINVALIDPSID Invalid RIBM presentation space short name.


9999 WHLLINVALIDRC Invalid character in the Length parameter. Letter is not P or R.

Remarks
The Convert (99) function does not update the cursor position.

The Convert (99) function calculates the position taking the model number into
consideration.
196 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Connect Window Services (101)

Description
The Connect Window Services (101) function allows the client application to manage the RIBM
presentation space windows.
Prerequisite
None.
Function Call
WORD WinHLLAPI(

LPWORD CONNECTWINDOWSERVICES, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 101


Data String One of the following:
a letter A-Z, which indicates the RIBM presentation space
short name.
a (space) which indicates the currently connected RIBM
presentation space.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 WHLLOK The Connect Window Services (101) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space short name.
9 WHLLSYSERROR System error.
11 WHLLUNAVAILABLE The RIBM presentation space is busy.
Reflection for IBM HLLAPI Reference 197

WinHLLAPI Function

Disconnect Window Services (102)

Description
The Disconnect Window Services (102) function disconnects the WinHLLAPI application and
the RIBM presentation space windows.
Prerequisite
Connect Window Services (101).
Function Call
WORD WinHLLAPI(

LPWORD DISCONNECTWINDOWSERVICES, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 102


Data String One of the following:
a letter A-Z, which indicates RIBM presentation
space short name.
a (space) which indicates for the currently
connected presentation.
Length Not applicable.
PS Position Not applicable.

Return Codes

0 WHLLOK The Disconnect Window Services (102) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space short name.
9 WHLLSYSERROR System error.
198 Reflection for IBM HLLAPI Reference

Remarks
When WinHLLAPI has called Disconnect Window Services (102) it no longer manages the
RIBM presentation space window. Before you exit the application, exit with a call to
Disconnect Window Services (102) so all connected RIBM presentation spaces will disconnect
and no outstanding connection will be canceled.

WinHLLAPI Function

Query Window Coordinates (103)

Description
The Query Window Coordinates (103) function returns window coordinates on the
presentation.

A return code of 0,0 indicates the top-left coordinates.


Prerequisite
Connect Window Services (101).
Function Call
WORD WinHLLAPI(

LPWORD QUERYWINDOWCOORDINATES, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 103


Data String a letter A-Z, which indicates the RIBM presentation
space short name.
a (space) which indicates the currently connected
RIBM presentation space.
Length Defaults to 17.
PS Position Not applicable.
Reflection for IBM HLLAPI Reference 199

Return Parameters
Data String:

Bytes 1 Presentation space short name. (A-Z).

Bytes 2-5 Specifies the X-coordinates of the windows upper-left corner.

Bytes 6-9 Specifies the Y-coordinates of the windows lower-right corner.


Bytes 10-13 Specifies the X-coordinates of the windows lower-right corner.

Bytes 14-17 Specifies the Y-coordinates of the windows upper-left corner.


Return Codes

0 WHLLOK The Query Window Coordinates (103) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space short name.
9 WHLLSYSERROR System error.

Remarks
This function is not supported for 5250.

WinHLLAPI Function

Window Status (104)

Description
The Window Status (104) function can be used to query or change a windows RIBM presen-
tation space size, location, or visibility. You can also move, maximize or minimize a specified
window.
Prerequisite
Connect Window Services (101).
Function Call
WORD WinHLLAPI(

LPWORD WINDOWSTATUS, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
200 Reflection for IBM HLLAPI Reference

Call Parameters

Function Number 104


Data String See Window Status.
Length A value between 16 and 20.
PS Position Not applicable.

Return Codes

0 WHLLOK The Window Status (104) function completed


successfully.
1 WHLLNOTCONNECTED Invalid RIBM presentation space short name.
2 WHLLPARAMETERERROR Parameter specification error.
9 WHLLSYSERROR System error.

Remarks
This function is not supported for 5250 sessions.

WinHLLAPI Function

Change PS Window Name (106)

Description
The Change PS Window Name (106) function allows an application to reset or change the RIBM
presentation space window name.
Prerequisite
Connect Window Services (101).
Function Call
WORD WinHLLAPI(

LPWORD CHANGEPSNAME, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code
Reflection for IBM HLLAPI Reference 201

Call Parameters

Function Number 106


Data String One of the following:
Byte 1 a letter A-Z, which indicates presentation short name.
a (space) which indicates for the currently connected
presentation.
Byte 2 A change request value:
X01 Change the RIBM presentation space window name.
X02 Reset the RIBM presentation space window name.
Bytes 3-63 An ASCII string that specify the new name. This string must
end with a null character.
Length A length between 3 and 63.
PS Position Not applicable.

Return Codes

0 WHLLOK The Change PS Window Name (106) function was


successful.
1 WHLLNOTCONNECTED Invalid RIBM presentation space short name.
2 WHLLPARAMETERERROR Parameter specification error.
9 WHLLSYSERROR System error.
202 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Run Profile (1000)

Description
Run Profile starts a RIBM presentation space with the specified settings file.
Prerequisite
None
Function Call
WORD WinHLLAPI(

LPWORD RunProfile, // Pointer to function number


LPSTR lpbyString, // Pointer to data string
LPWORD lpwLength, // Pointer to length
LPWORD lpwReturnCode) ; // Pointer to return code

Call Parameters

Function Number 1000


Data String Name, including the extension and full path, of the settings file to load.
Length Constant or value that determines how the RIBM presentation space is
displayed.

See below.

Constant Value Description

0 SW_HIDE Hides the window.


1 SW_SHOWNORMAL Displays a window.
2 SW_SHOWMINIMIZED Shows the window as an icon.
3 SW_SHOWMAXIMIZED Shows the window and displays it as a
maximized window.
Reflection for IBM HLLAPI Reference 203

Constant Value Description

4 SW_SHOWNOACTIVATE Displays a window in its most recent size


and position. The current active window
remains active.
5 SW_SHOW Shows a window and displays it in its
current size and position.
6 SW_MINIMIZE Minimizes the specified window and
activates the top-level window in the
systems list.
7 SW_SHOWMINNOACTIVE Shows the window as an icon. The current
active window remains active.
8 SW_SHOWNA Shows the window in its current state. The
current active window remains active.
9 SW_RESTORE Restores a minimized or maximized
window to its original size. (Same as
SW_SHOWNORMAL).

PS Position Not applicable.


Return Codes

0 WHLLOK The Run Profile (1000) function was successful.


2 WHLLPARAMETERERROR Invalid profile parameter.
9 WHLLSYSERROR System error. The profile was found. The executable
file was not found.
204 Reflection for IBM HLLAPI Reference

WinHLLAPI Function

Get Session HWND (1002)

Description
The Get Session HWND (1002) function returns the instance handle of the currently
connected RIBM presentation space.
Prerequisite
None.
Function Call
WinHLLAPI(GetSessionHWND,lpbyString,lpwLength,lpwReturnCode).
Call Parameters

Function Number 1002


Data String An application short name. The instance handle.
Length Must be 4.
PS Position Not applicable.

Return Parameters
Data String The instance handle.
Return Codes
>0 The instance handle.

1 WHLLNOTCONNECTED Application is not connected to a RIBM presentation space.


9 WHLLSYSERROR System error.
Reflection for IBM HLLAPI Reference 205

WinHLLAPI Reference

WinHLLAPI Return Codes

Summary of WinHLLAPI Return Codes

Number Code Description

0 WHLLOK The function call was successfully completed.


1 WHLLNOTCONNECTED Your WinHLLAPI application is not
connected to a RIBM PS. Check the RIBM PS
SHORT NAME.
1 WHLLBLOCKNOTAVAIL Requested size is not available.
2 WHLLPARAMETERERROR At least one WinHLLAPI parameter was
incorrect. Check the parameter length or
order.
3 WHLLFTXCOMPLETE File transfer was successfully completed.
4 WHLLFTXSEGMENTED File transfer complete with segmented records.
4 WHLLPSBUSY Function successfully completed, but the
RIBM PS is busy. The X CLOCK (Mainframe)
or II (AS/400) is displayed on the OIA. If
sending data, some keystrokes could not be
sent.
5 WHLLINHIBITED Host session inhibited, not all keystrokes
could be sent. The application may try to send
keystrokes or data to a protected field.
6 WHLLTRUNCATED Data was truncated. The data length or the
buffer size may be incorrect.
7 WHLLPOSITIONERROR The specified RIBM PS position is invalid.
Check the RIBM PS size with the Query
Session function. The position must be within
0 and the maximum size of the RIBM PS.
206 Reflection for IBM HLLAPI Reference

Number Code Description

8 WHLLNOTAVAILABLE The function is not available. Conflicting


functions or missing prerequisite.
9 WHLLSYSERROR A system error was encountered. Use the
Query System (20) function to determine the
cause of the problem then call Reset System
or terminate the application.
10 WHLLNOTSUPPORTED This function is not supported for the
WinHLLAPI client program.
11 WHLLUNAVAILABLE The resource is unavailable.
12 WHLLPSENDED The session stopped
20 WHLLUNDEFINEDKEY Undefined keystroke combination.
21 WHLLOIAUPDATE The OIA was updated.
22 WHLLPSUPDATE RIBM PS was updated.
23 WHLLBOTHUPDATE Both the OIA and RIBM PS were updated.
24 WHLLNOFIELD No such field was found. The RIBM PS
may be unformatted.
25 WHLLNOKEYSTROKES There are no keystrokes available in the
keyboard buffer.
26 WHLLPSCHANGED The OIA or RIBM PS was updated.
27 WHLLFTXABORTED File transfer terminated by a Ctrl+Break,
or because file transfer timed out.
28 WHLLZEROLENFIELD The field length is 0 bytes.
31 WHLLKEYOVERFLOW Keystroke overflow in the keyboard buffer.
32 WHLLSFACONN Other application already connected.
34 WHLLTRANCANCLI Message sent inbound to host canceled.
35 WHLLTRANCANCL Outbound transfer from host canceled.
Reflection for IBM HLLAPI Reference 207

Number Code Description

36 WHLLHOSTCLOST Contact with host was lost.


37 WHLLOKDISABLED The function was successful.
38 WHLLNOTCOMPLETE The requested fn was not completed.
39 WHLLSFDDM One DDM session already connected.
40 WHLLSFDPEND Disconnected with asynchronous requests
pending.
41 WHLLBUFFINUSE Specified buffer currently in use.
42 WHLLNOMATCH No matching request found.
43 WHLLLOCKERROR API already locked or unlocked.
301 WHLLINVALIDFUNC- Invalid function number.
TIONNUM
302 WHLLFILENOTFOUND File Not Found.
305 WHLLACCESSDENIED Access Denied.
308 WHLLMEMORY Insufficient Memory.
310 WHLLINVALIDENVI- Invalid environment.
RONMENT
311 WHLLINVALIDFORMAT Invalid format.
9998 WHLLINVALIDPSID An invalid RIBM PS SHORT NAME was
specified or a system error occurred.
9999 APIINVALIDRC An invalid Row or Column parameter was
specified.
208 Reflection for IBM HLLAPI Reference

WinHLLAPI Reference

File Transfer with VM/CMS

[d:][path]filename[.ext] w: fn [ft] [fm] [(options]

VM/CMS File Transfer Parameters

Parameter Description

[d:] Defines a disk drive where the PC file will be sent to or received from. If
you dont specify the drive, file transfer defaults to the current drive.
[path] Path for the PC file to be sent or target file to be received. If you dont
specify the path, it defaults to the C:\ on the PC.
filename File name of the file to be sent or received.
[.ext] File extension of the file to be sent or received.
w: Sessions short name for a CMS session (followed by a colon) for sending
or receiving files. A letter between A - Z. If you dont, the host session in
focus would be the target.
fn File name of the file being sent or received from the host session.
[ft] The file type of the host file to be sent or received, if any.
[fm] Optional parameter which indicates the host file mode. If Send File (90),
this parameter indicates to CMS which disk drive the file is sent to.
(options The Options parameter is preceded by a single left parenthesis. See below
for VM/CMS File Transfer Options.
Reflection for IBM HLLAPI Reference 209

VM/CMS File Transfer Options

Option Description

append Appends a transferred file to the end of an existing file. append overrides
specified values for the lrecl and recfm options.
ascii Converts ASCII to EBCDIC when EHLLAPI sends a file to the host
session, and converts EBCDIC to ASCII when the PC session receives a file
from the host session. If the file is a text file, ASCII mode is recommended.
bufsize Enables EHLLAPI to select a buffered file transfer option.

BUFSIZE = 2

BUFSIZE = 4

BUFSIZE = 8

BUFSIZE = 32
crlf Deletes the carriage return/line feed characters during Send (90), and
appends them during Receive (91). Text data usually contains a crlf
character at the end of each line. If you delete these characters the file will
be easier to read
lrecl n Specifies that the host file contains fixed-length records. If strings are
shorter than n, the buffers will be padded with space characters. Send File
(90) only.
recfm f Specifies that the file will contain variable length records. Send File (90).

Use of the recfm v option without the crlf option is recommended when
padding of mainframe records or deletion of trailing spaces must not
occur.
210 Reflection for IBM HLLAPI Reference

WinHLLAPI Reference

File Transfer with VMS/TSO

[d:][path]filename[.ext] w: dsn [(member)] [lpw] [options]

VMS/TSO File Transfer Parameters


Parameter Description
[d:] Defines a drive for the PC file to be sent to or received from. If you dont
specify the drive, file transfer defaults to the current drive.
[path] Path for the PC file to be sent or target file to be received.
filename File name of the file to be sent or received.
[.ext] File extension of the file to be sent or received..
w: Sessions short name for a TSO session (followed by a colon) for sending
or receiving files. A letter between A - Z.
w: The target sessions short name in which you have established a TSO
session (followed by a colon) for sending or receiving files. For example, in
session Session1, A would be the sessions short name. If not specified, the
first open mainframe session would be the target.
dsn TSO dataset name you assign to the file when you send it to the host
session, or the TSO dataset name of the file to be received on the PC
session.
[(member)] Optional parameter that tells TSO to save (when sending), or if the file was
saved (when receiving) as a partitioned dataset. Partitioned dataset files
save mainframe disk space.
[lpw] Send File (90)
The parameter tells TSO to be password protected. You must create a
password if you want your file protected.

Receive File (91)


Include this parameter with the appropriate password if the file was
password protected.
options See the VMS/TSO File Transfer Options below.
Reflection for IBM HLLAPI Reference 211

VMS/TSO File Transfer Options


Option Description
append Appends a transferred file to the end of an existing file. append overrides
specified values for the lrecl and recfm options.
ascii Converts ASCII to EBCDIC when EHLLAPI sends a file to the host
session, and converts EBCDIC to ASCII when the PC session receives a file
from the host session. If the file is a text file, ASCII mode is recommended.
crlf Deletes the carriage return/line feed characters during Send (90), and
appends them during Receive (91). Text data usually contains a crlf
character at the end of each line. If you delete these characters the file will
be easier to read
lrecl n Specifies that the host file contains fixed-length records. If strings are
shorter than n, the buffers will be padded with space characters. Send File
(90) only.
blksize(n) Block size of the host file dataset, where n is the length in bytes of a data
block. If you omit blksize, the default is lrecl + 4 for new files. If you are
appending or replacing a dataset, blksize is ignored. Send File (90) only.
recfm(f) The host file will contain fixed-length records. Records are padded with
space characters if they are shorter than that specified with lrecl or the
default length.
recfm(u) Records of undetermined length. Send File (90) only.
recfm(v) Records of variable length records.
-B Do no use structured fields.
-S Structured field file transfer.
space Amount of space to be allocated for a new dataset.
212 Reflection for IBM HLLAPI Reference

WinHLLAPI Reference

WinHLLAPI AID Keys

The table below shows the valid AID keys for 3270, 5250, and asynchronous sessions.
3270 AID keys 5250 AID keys Asynchronous AID keys
Attn Clear Function keys
Clear Enter Enter
Cursor Select PF keys Numlock
Enter Help Number Pad /
PF keys PA1 - PA3 Number Pad *
PA1 - PA3 Page Down Number Pad -
System Request Page Up
Print
System Request
Test Request
Reflection for IBM HLLAPI Reference 213

WinHLLAPI Reference

WinHLLAPI Window Status

Request Option WHLL_WINDOWSTATUS_SET


Set window status - a 16-byte string with the following format:

Byte Description

Byte 1 a letter A-Z, which indicates presentation short name.

a (space) which indicates for the currently connected presen-


tation space.
Byte 2 WHLL_WINDOWSTATUS_SET for Set status.
Bytes 3-4 If the request option is Set Status the following codes are valid:
WHLL_WINDOWSTATUS_SIZE
Change the window size.

WHLL_WINDOWSTATUS_MOVE
Move the window x or y position.

WHLL_WINDOWSTATUS_ZORDER
Specifies ZORDER placement.

WHLL_WINDOWSTATUS_SHOW
Set the window to visible.

WHLL_WINDOWSTATUS_HIDE
Set the window to invisible.
214 Reflection for IBM HLLAPI Reference

Byte Description

WHLL_WINDOWSTATUS_ACTIVATE
Activate the window.

WHLL_WINDOWSTATUS_DEACTIVATE
Deactivate the window.

WHLL_WINDOWSTATUS_MINIMIZE
Set the window to minimized.

WHLL_WINDOWSTATUS_MAXIMIZE
Set the window to maximized.
WHLL_WINDOWSTATUS_RESTORE
Restore the window .
Bytes 5-6 Specifies the x-coordinate of the upper-left corner of the window.
Ignored if the move option is not set.
Bytes 7-8 Specifies the y-coordinate of the upper-left corner of the window.
Ignored if the move option is not set
Bytes 9-10 Specifies the X window size (width). Ignored if
WHLL_WINDOWSTATUS_MOVE is not set.
Bytes 11-12 Specifies the Y window size (height). Ignored if
WHLL_WINDOWSTATUS_MOVE is not set.
Bytes 13-16 Specifies the ZORDER placement of the window. This option is valid
only if WHLL_WINDOWSTATUS_ZORDER is specified. Valid
values are:

WHLL_WINDOWSTATUS_FRONT. Places the widow in the front


of the z-order
WHLL_WINDOWSTATUS_BACK. Places the window in the back
of the z-order
Reflection for IBM HLLAPI Reference 215

Remarks
WHLL_WINDOWSTATUS_MAXIMIZE, WHLL_WINDOWSTATUS_MINIMIZE and
WHLL_WINDOWSTATUS_RESTORE are all mutually exclusive with respect to each other
therefore only one can be specified at a time. WHLL_WINDOWSTATUS_ACTIVATE
and WHLL_WINDOWSTATUS_DEACTIVATE are also mutually exclusive and so are
WINDOWSTATUS_FRONT and WHLL_WINDOWSTATUS_BACK
Request Option WHLL_WINDOWSTATUS_QUERY
Query window status - a 16-byte string with the following format:
Byte 1

Short name session ID of the desired host session, or space or null for the current host session.

Byte 2

WHLL_WINDOWSTATUS_QUERY for query status.

Bytes 3-4

An integer containing WHLL_WINDOWSTATUS_NULL. The following are possible return


values. More than one status is possible.
WHLL_WINDOWSTATUS_SHOW. The window is visible.

WHLL_WINDOWSTATUS_HIDE. The window is invisible.

WHLL_WINDOWSTATUS_ACTIVATE. The window is activated.

WHLL_WINDOWSTATUS_DEACTIVATE. The window is deactivated.

WHLL_WINDOWSTATUS_MINIMIZE. The window is minimized.

WHLL_WINDOWSTATUS_MAXIMIZE. The window is maximized.

Bytes 5-6

Specifies the x-coordinate of the upper-left corner of the window. Ignored if the move option
is not set.

Bytes 7-8

Specifies the y-coordinate of the upper-left corner of the window. Ignored if the move option
is not set
216 Reflection for IBM HLLAPI Reference

Bytes 9-10

Specifies the X window size (width).

Bytes 11-12

Specifies the Y window size (height)


Byte 13-16 is ignored and is left only for backward compatibility.
Request Option X03
Query extended window status - a 20-byte string with the following format:
Byte 1

Short name session ID of the desired host session, or space or null for the current host session.

Byte 2

WHLL_WINDOWSTATUS_EXTQUERY for query extended status.

Bytes 3-4
An integer containing WHLL_WINDOWSTATUS_NULL. The following are possible return
values. More than one status is possible.

WHLL_WINDOWSTATUS_SHOW. The window is visible.

WHLL_WINDOWSTATUS_HIDE. The window is invisible.

WHLL_WINDOWSTATUS_ACTIVATE. The window is activated.

WHLL_WINDOWSTATUS_DEACTIVATE. The window is deactivated.

WHLL_WINDOWSTATUS_MINIMIZE. The window is minimized.

WHLL_WINDOWSTATUS_MAXIMIZE. The window is maximized.

Bytes 5-6

Specifies the current font height. The size assumes a fixed-pitch font including any inter-
column spacing (this value times the number of displayed columns should equal the width of
the presentation space).
Reflection for IBM HLLAPI Reference 217

Bytes 7-8

Specifies the current font width. The size includes any inter-line spacing (this value times the
number of displayed rows should equal the height of the presentation space).

Bytes 9-10

Specifies the distance from the left edge of the window to the first displayed column of the host
screen, or zero if the host presentation space exactly fits the window.
Bytes 11-12

Specifies the distance from the top of the window to the first displayed row of the host screen,
or zero if the host presentation space exactly fits the window.

Bytes 13-14

Specifies the number of the first visible row of the presentation space. This is normally one
unless only a portion of the presentation space is visible in the window.

Bytes 15-16

Specifies the number of the first visible column of the presentation space. This is normally one
unless only a portion of the presentation space is visible in the window.

Bytes 17-20

Specifies the window handle of the emulator session.


218 Reflection for IBM HLLAPI Reference

WinHLLAPI Reference

WinHLLAPI ASCII Mnemonics

This table is used when your application is calling Send Key (3) or Get Key (51).

Meaning Mnemonic
@ @@
Alt @A
Alt Cursor @$
Attention @A@Q
Backspace @<
Backtab (Left Tab) @B
Clear @C
Cmd (function) Key @A@Y
Cursor Down @V
Cursor Left @L
Cursor Right @Z
Cursor Select @A@J
Cursor Up @U
Delete @D
Dup @S@x
End @q
Enter @E
Erase EOF @F
Erase Input @A@F
Field Exit @A@E
Field Mark @S@y
Field - @A@-
Reflection for IBM HLLAPI Reference 219

Meaning Mnemonic
Field + @A@+
Help @H
Hexadecimal @A@X
Home @0 (zero)
Insert @I
Insert Toggle @A@I
Local Print @P
New Line @N
Page Up @u
Page Down @v
Print (PC) @A@t
Print Screen @A@T
Record Backspace @A@<
Reset @R
Shift @S
Sys Request @A@H
Tab (Right Tab) @T
Test @A@C
PA1 @x
PA2 @y
PA3 @z
PA4 @+
PA5 @%
PA6 @&
PA7 @
PA8 @(
220 Reflection for IBM HLLAPI Reference

Meaning Mnemonic
PA9 @)
PA10 @*
PF1/F1 @1
PF2/F2 @2
PF3/F3 @3
PF4/F4 @4
PF5/F5 @5
PF6/F6 @6
PF7/F7 @7
PF8/F8 @8
PF9/F9 @9
PF10/F10 @a
PF11/F11 @b
PF12/F12 @c
PF13/F13 @d
PF14/F14 @e
PF15/F15 @f
PF16/F16 @g
PF17/F17 @h
PF18/F18 @i
PF19/F19 @j
PF20/F20 @k
PF21/F21 @l
PF22/F22 @m
PF23/F23 @n
PF24/F24 @o
Reflection for IBM HLLAPI Reference 221

WinHLLAPI Reference

Presentation Space Buffer Sizes


Models 3270 Resolution Size without EABs Size with EABs

2 24x80 1920 3840


3 32x80 2560 5120
4 43x80 3440 6880
5 27x132 3564 7128

Models 5250 Resolution Size without EABs Size with EABs

2 24x80 1920 Not supported


5 27x132 3564 Not supported

WinHLLAPI Reference

WinHLLAPI Character and Field Attributes


3270 and 5250 Character and Field Attributes
3270 and 5250 Character Attributes.

3270 and 5250 Character Color Attributes.

3270 and 5250 Field Attributes.


Character Attributes
3270 character attributes
Bit Position Description

0-1 Character highlighting


00 = Normal
10 = Reverse video
01 = Blink
11 = Underline
222 Reflection for IBM HLLAPI Reference

2-4 Character color


000 = Default
100 = Green
001 = Blue
101 = Turquoise
010 = Red
110 = Yellow
011 = Pink
111 = White

5-7 Reserved (not used)


5250 Character Attributes
Bit Position Description

0 Reverse image
0 = Normal
1 = Reverse

1 Underscore
0 = None
1 = Underscore

2 Blink
0 = None
1 = Blink

3 Column separators
0 = None
1 = Column separators

4-7 Reserved (not used)


Reflection for IBM HLLAPI Reference 223

3270 and 5250 Character Color Attributes


Bit Position Description

0-3 Background character colors


0000 = Black
0100 = Red
0001 = Blue
0101 = Magenta
0010 = Green
0110 = Brown
0011 = Cyan
0111 = White

4-7 Foreground character colors


0000 = Black
1000 = Gray
0001 = Blue
1001 = Light blue
0010 = Green
1010 = Light green
0011 = Cyan
1011 = Light cyan
0100 = Red
1100 = Light red
0101 = Magenta
1101 = Light magenta
0110 = Brown
1110 = Yellow
0111 = White
1111 = High intensity white
224 Reflection for IBM HLLAPI Reference

Field Attributes
3270 Field Attributes
Bit Position Meaning

0-1 Both set to 1 (field attribute byte)

2 Unprotected/protected
0 = Unprotected data field
1 = Protected data field

3 Alpha/numeric
0 = Alphanumeric data
1 = Numeric data only
4-5 I/SPD
00 = Normal intensity, pen not detectable
01 = Normal intensity, pen detectable
10 = High intensity, pen detectable
11 = Non-display, pen not detectable

6 Reserved

7 MDT (Modified Data Tag)


0 = Field has not been modified
1 = Field has been modified
Reflection for IBM HLLAPI Reference 225

5250 Field Attributes


Bit Position Meaning

0 Field attribute flag


0=Not a field attribute
1=Field attribute byte

1 Visibility
0 = Non-display
1 = Display

2 Unprotected/protected
0 = Unprotected data field
1 = Protected data field
3 Intensity
0 = Normal
1 = High

4-6 Field Type


000 =Alphanumeric: all characters allowed
001 = Alphabetic only
010 = Numeric shift: automatic shift for numeric
011 = Numeric only
100=Reserved
101=Digits:
110=Magnetic stripe reader data only
111=Signed Numeric

7 MDT
0 = Field has not been modified
1 = Field has been modified
226 Reflection for IBM HLLAPI Reference

WinHLLAPI Reference

OIA Image Symbols for 3270 Sessions


Reflection for IBM HLLAPI Reference 227

WinHLLAPI Reference

WinHLLAPI Prerequisite Functions

No prerequisite
Connect Presentation Space (1)
Connect Window Services (101)
Convert Position/RowCol (99)
Pause (18)
Query Session Status (22)
Query Sessions (10)
Query System (20)
Receive File (91)
Reset System (21)
Send File (90)
Set Session Parameters (9)
Start Host Notification (23)
Start Close Intercept (41)
Start Keystroke Intercept (50
Connect Presentation Space ()
Copy Field to String (34)
Copy OIA (13)
Copy Presentation Space (5)
Copy Presentation Space to String (8)
Copy String to Field (33)
Copy String to Presentation Space (15)
Disconnect Presentation Space (2)
Find Field Length (32)
Find Field Position (31)
Query Cursor Location (7)
Query Field Attribute (14)
Release (12)
Reserve (11)
Search Field (30)
Search Presentation Space (6)
Send Key (3)
Set Cursor (40)Wait (4)
228 Reflection for IBM HLLAPI Reference

Start Host Notification (23)


Query Host Update (24)
Stop Host Notification (25)
Start Close Intercept (41)
Query Close Intercept (42)
Stop Close Intercept (43)
Start Keystroke Intercept (50)
Get Key (51)
Post Intercept Status (52)
Stop Keystroke Intercept (53)
Connect Window Services (101)
Disconnect Window Services (2)
Query Window Coordinates (103)
Change PS window name (105)
Window Status (104)

You might also like