Using an ActiveX Display Session

Version 8.0.5


This Help file describes the ActiveX Display control user interface and lists its features.

HostFront for the AS/400 delivers true 5250 display emulation over the Internet or on an intranet by downloading an ActiveX control via HTTP or TCP/IP.

From the Internet Explorer Web browser, which supports ActiveX controls, users can request one or more Display sessions. Each session appears in a separate browser window. When the user closes the session, the control is automatically removed from the user PC desktop, freeing up resources for other applications.

The ActiveX Display control features an intuitive user interface that has functions and interactions associated with 5250 terminal "green screens." The ActiveX Display control also provides access to 5250 functions, such as Enter and Function keys, directly from the keyboard.

 

ActiveX Display Control Features


The ActiveX Display control includes all the standard features of an IBM 5250 terminal plus additional ones that are only possible within a PC environment.

Persistent Connection 

A client can establish a TCP/IP connection to HostFront Server. 

Non-persistent Connection 

A client can establish an HTTP connection to HostFront Server. 

HotSpot 

You can configure your mouse to select AS/400 menu items or launch function-key commands on your AS/400 application screen. 

Type Ahead 

When the Input Inhibited status indicator appears, HostFront stores the next 256 keystrokes in memory (default). You can change this amount in the Data Transfer tab of the ActiveX Display Properties dialog box. For more information, see Modifying your Data Processing Properties below.

Once you re-enable your input status, the AS/400 processes the stored keystrokes normally. 

System Function Keys 

The traditional function keys of a 5250 terminal are mapped to their respective keys on the PC keyboard.

For example:

  • the 5250 Enter key is mapped to the [Enter] key of the PC keyboard

  • the 5250 function keys are mapped to the function keys of the PC keyboard.

The remaining 5250 function keys are mapped to combination keys on the PC keyboard. Click the Keyboard Mapping button on the ActiveX Display Toolbar to view the combination keys for these functions.  

Local Print Screen 

You can print the contents of your Display control using your Web browser, OLE application, or a custom application. 

OLE-compliant object 

You can insert the ActiveX Display control as an OLE object into any OLE-compliant application, such as Microsoft Word or Excel, allowing you to connect to the AS/400 without having to launch Internet Explorer. 

One session per browser 

An ActiveX Display occupies one instance of Internet Explorer allowing you to open multiple Display sessions. 

Local color mapping and font selection 

You can select the attribute color for each element in the ActiveX Display control.

You can choose any of the standard Microsoft Windows' colors or assign a desktop attribute to a 5250 Display session attribute to obtain a consistent look and feel with your desktop. You can also select the font, font style, and font size for your Display session.  

GUI Transform 

Allows you to change the flat appearance of the traditional green screen to a graphical user interface 

Copy/Paste 

Allows you to copy and paste fields from a Display screen into a spreadsheet program. 

Dynamic font and window resizing 

The session window of the ActiveX Display control automatically occupies the entire window area of Internet Explorer and can resize the font to match the available area.

Resize the font using the Increase Font Size and Decrease Font Size buttons. 

 

Starting an ActiveX Display Control

Once you start your ActiveX Display control, you can customize it to suit your needs. The Display control allows you to:

These instructions assume that you have already connected to the Web Server.

To start the ActiveX Display control, follow these steps:

  1. Click the Display button on the HostFront ActiveX Startup page. The ActiveX Display window opens. The HostFront Server Signon dialog box only opens when you aren't logged on to the NT domain as a trusted NT domain user.

    Note: The HostFront Server Signon dialog box is not the AS/400 Sign on screen. It allows users to access HostFront only. Sign on to the AS/400 using a traditional AS/400 Sign on screen that opens later.

  2. Enter your HostFront user name and password and press [Enter].

    If the user name or the password is incorrect, the HostFront Server Signon dialog box reopens. If you close the HostFront Server Signon dialog box without entering a valid user name and password, the Connect button will be dimmed.

    You need to click the Signon button again to obtain the HostFront Server Signon dialog box and enter a valid user name and password.

  3. Once you successfully sign on to HostFront, the AS/400 Sign On screen opens.

  4. If you want to sign on to HostFront Server using another user name, follow these steps:

  5. If you want to change your password, you must not be connected to the AS/400. If you aren't allowed to change your password, the Change Password button and the Change Password command will be disabled.

    To change your password, follow these steps:

    You have successfully changed your password. The next time you sign on to HostFront Server, you must use your new password.

  6. Click the Display button on the HostFront ActiveX Startup page if you want to open more Display sessions.

    You can launch as many Display sessions as the session limit allows. The session limit is defined in your client configuration or by the maximum number of concurrent sessions allowed by HostFront, whichever limit you reach first.

  7. To reload the session information, right-click the session window and select Reload from the Session sub-menu.

    Note: Do not use the Refresh button on the browser window to refresh the information on the display window. This causes the current session to disconnect.

  8. Click the About button or select About from the Help menu to see information on the ActiveX Display control.

    This button provides you with information on:

  9. Click the Local Print Screen button to print the contents of the Display control screen.

  10. Select Exit from the File menu to close the browser.

    You should always log off from the AS/400 and disconnect the session before you close your Display session. This prevents leaving the host session in an unresolved state. Click the Disconnect button to disconnect the Display session.

  11. The Data Encrypted button on appears on the ActiveX Display toolbar when this option is enabled in the HostFront Server properties.

    (You will not be able to toggle it off from the ActiveX Display window.)

Reading the ActiveX Display Status Line

Information about the current session appears in the status line of the ActiveX Display control. It provides the same information normally provided by IBM 5250 display terminals.

Rxx (Row Indicator): indicates the row position of the cursor. The valid row positions are 1 to 38. Therefore, R6 means the cursor is currently located on row 6.

Cxxx (Column Indicator): indicates the column position of the cursor. The valid column positions are 1 to 132. Therefore, C53 means the cursor is currently located on column 53.

SA (System Available): indicates the AS/400 is available.

MSG (Message Waiting): indicates the AS/400 has one or more messages for you.

II (Input Inhibited): indicates the AS/400 is not accepting keyboard input.

In most cases, II appears when the system is busy processing a previous request. However, input is occasionally inhibited due to an error and you need to press [Esc] to clear the error.

OVR/INS (Overwrite/Insert): These two modes are explained below. Select the Edit Mode command of the Properties menu to change the data entry mode.

INS indicates that when you type, your characters are inserted at the current cursor position without replacing any existing characters that follow. Any subsequent characters in the fields move over as you type.

OVR indicates that when you type, your characters overwrite any existing characters.

HFLU4S2 (Device Name): This indicator is the device name of the Display session on the host.

Changing the Display Control Properties

The ActiveX Display Properties dialog box allows you to change the font size and how the Display session accepts characters you type.

To change your Display session's properties, follow these steps:

  1. Click the Properties button on the ActiveX control toolbar. The ActiveX Display Properties dialog box opens.

  2. Click the tab whose properties you want to modify.

  3. Make your changes. If you want to modify another tab, select it and make your changes.

Saving your ActiveX Display Settings

When you make changes to the ActiveX Display control, you need to save them to a configuration file. By default, any changes you make to the ActiveX Display control properties will be saved to the configuration file listed in the Language tab when the Auto Save option is enabled in the Connection tab. When the Auto Save option is not enabled, all changes will be automatically saved to the default configuration file which is hfdsp.cfg.

If you want to save any changes to the configuration file listed in the Language tab, and the Auto Save option is not enabled in the Connection tab, right-click in the ActiveX Display control and select Session | Configuration | Save.

If you want to save any changes to a different configuration file, right-click in the ActiveX Display control and select Session | Configuration | Save As. In the Save Properties to File dialog box, choose the configuration file, and then click the Save button.

Modifying your General Properties

  1. Click the General tab to configure settings for auto sign on, auto start macro and the display of the Print dialog box.

  2. In the Auto Sign on panel, select

     

  3. To have a macro starting automatically after signing on, select one from the list in the Start up Macro panel. To remove a previously selected macro, just select the "None" item from the list.

     

  4. In the Screen Print section, you can select one of the following options from the list:

 

Modifying your Connection Properties

  1. Click the Connection tab to configure settings for an HTTP or a TCP/IP connection.

  2. In the Operation Mode panel, select

    If you do not check this checkbox, your modifications will be saved to the default ActiveX Display configuration file (hfdsp.cfg).

  3. Click on the Advanced button to configure your Connection mode settings. The following window opens.

  4. In the Connection mode panel, select the

    Checking this box will have no impact on the Persistent connection and vice versa.

Modifying your Appearance Properties

  1. Click the Appearance tab to define general characteristics about the ActiveX Display control.

  2. If you want to customize your ActiveX Display control's appearance, make sure the Use Server Colors and Use Server Font Size checkboxes are not selected.

    When you select Use Server Colors and/or Use Server Font Size checkboxes, the ActiveX Display ignores any changes you made to the session color and/or font size and uses the server defaults.

  3. Select the View Resized to Fit checkbox to force the Display session window to occupy the whole visible area in Internet Explorer.

  4. Select the Font resized to fit checkbox to force the ActiveX Display control to resize the font as you change the window size.

    If you do not select this checkbox, the font size does not change as you change the window size. You can resize the font manually using the Increase Font Size and Decrease Font Size buttons.

  5. Select one of the following options from the GUI-on-the-fly panel.

  6. In the Cursor Caret Type panel, select how you want your cursor to appear.

     

  7. Select the Show Ruler Lines check box to enable the display of ruler lines on the screen

     

  8. Select the Show System Request menu to display the system request menu screen when hitting the system request key combination. If this option in unchecked, the display will show a line just above the status line where the user can enter the system request option without displaying the menu.

Modifying your Data Processing Properties

  1. Click the Data Processing tab to define the terminal options that control how data is managed by the ActiveX Display control.

  2. Type the number of milliseconds that the host should wait to receive data before it ends the transfer with the client in the Server data settle time field. If you enter -1 in this field, the host uses its own timeout value.

  3. Select the Error Recovery checkbox to allow HostFront or the host to restart a data transfer that encountered an error during transmission.

    You should always leave this checkbox selected. It is used primarily for testing purposes to determine when an error occurs during data transmission.

  4. In the Keyboard Mode panel, type the maximum number of keys that the Display control will allow you to type ahead in the Type-ahead keys field. If the Display control is busy and can't display the characters you are typing immediately, it stores them in memory and displays them when it is no longer busy.

  5. In the Keyboard Mode panel, select the Insert (vs. Overwrite) checkbox to insert the characters you type at the current cursor position without replacing any existing characters that follow. Any subsequent characters in the fields move over as you type.

    Switch between modes during a session by pressing the [Insert] key. This checkbox defines the default mode.

  6. Non-Persistent Server Polling Setup allows you to automatically refresh your Display session with the latest data from the host server. HostFront sends a request to the host for new data at a defined interval. This process is known as polling.

  7. Click on the Replace with Blanks radio button and enter an integer in the box. A tab space will be converted into the number of blank spaces specified in this option when you copy cells from a spreadsheet and paste them into the ActiveX Display control. Conversely, blank spaces equal to the number entered in this option will be converted into a tab space when you paste text from the ActiveX Display control into a spreadsheet.

    Note: You have to hold down the Shift key when pasting text into the ActiveX Display control for this option to take effect.

    For example, if you copy three cells in a row of a spreadsheet and paste them into the ActiveX Display control, each tab space separating the cells will be converted into the number of blank spaces specified in this option.

    When you copy text from the ActiveX Display control and paste it into a spreadsheet, blank spaces between the copied text will be converted into a tab space based on the value specified in this option.

    Note: You need to hold down the Shift key when copying text from the ActiveX Display control for this option to take effect.

    For example, if you set the number of blank spaces to four (4), any four spaces between the text that you copy from the ActiveX Display control will be converted into one tab space in a spreadsheet; therefore, text separated by four (4) spaces will go into separate cells in the spreadsheet. Every four blank (4) spaces will be the equivalent of a tab space; therefore, eight (8) blank spaces will be converted into two (2) tab spaces and so on.

  8. Host display fields are normally separated by a tab. Click the Enable paste to next field radio button if you want the host tab space to be recognized in a spread sheet when you copy and paste text from the ActiveX Display control.

Modifying Your Language Properties

  1. Click the Language tab to see the language settings of the ActiveX Display session.

  2. The Preferred Language box is for notification purposes only. This box is inaccessible to the user. This setting reflects the language that the administrator chose for this particular user.

  3. In the Local Configuration File, enter the path and file name to which you would like to save these settings or click on the Browse button to select a current configuration file to which to save these settings.

Modifying Your Application Properties

  1. Click the Application tab to configure or modify the settings for launching an application. This tab allows a user to define an application that is launched from the ActiveX Display control. To launch the application, a user must define a key combination or press the application icon (if it is set in this property page) in the ActiveX Display toolbar.

  2. Type the path of the application in the Application Path field or click on Browse to find the application.

  3. In the Key to trigger application launch panel, you must select a combination of the system keys (Shift, Ctrl, and Alt) and any key from the drop-down list as shown in the panel above.

  4. To display an icon representing the application in the ActiveX Display session's toolbar, select the Show Launch icon on Toolbar checkbox.

    Note: The parameters entered in the Data Source panel must be meaningful to the application to which these parameters are passed when it launches.

    The parameters entered in the Data Source panel must be meaningful to the application to which these parameters are passed when it launches.

  5. When the From Selected Fields radio button is chosen,

    Select Title from the drop-down list and enter values in the Row and Column fields that correspond to the position of the title of your host screen.

    Enter a value in the Length (Opt) field. (If you leave this field at zero, then all of the data in the corresponding host field will be validated). Suppose you enter 3 in the Length (Opt) field and you have selected Title from the drop-down list. The first three characters of the host screen title will be compared against the first three characters of the name in the Screen Title box.

    Note: If you enter the value of 0 into the Row, Column, and Length(Opt) fields, the Screen Title will not be compared and validated when you launch your application even when the wrong host screen is active.

    Type the name of the host screen that will be active (when the application is launched) in the Screen Title box. The name that you enter in this box will be validated when you launch your program. In other words, the Screen Title will be compared with the name and position (based on the Row and Column parameters) of the host screen title. If no screen title is defined, no host screen validation is performed.

    Note: If the Row and Column co-ordinates are wrong and/or the Screen Title doesn't match that of the host screen, an "Invalid Co-ordinates: Title" error message or an "Invalid Co-ordinates:Field x" error message will appear (x refers to the number of a particular field, one through five).

    Select a Field from the drop-down list and fill in the same parameters as you did for the Title option. There are five Field parameters.

  6. When the Entire Screen radio button is selected no validation of the host screen is performed. When the application is launched, the entire screen buffer is passed to a portion of memory that is shared by all instances of the ActiveX Display session and the application. You must define a Share Memory: Name and a Share Memory: Size that both processes will understand. The ActiveX Display session passes the screen buffer data to the application via a memory buffer that is shared by both.

    Note: Be careful when you change the Share Memory: Name and Share Memory: Size. Each time they are changed, a new Share Memory object with the new size is created. If prior to changing these settings, the application has already been launched (and the process is still alive), the application won't be able to access the new Share Memory object. Also, the current instance of an ActiveX Display session won' t be able to relaunch the application. Close the application before making changes to the Share Memory settings. Remember: each instance of the ActiveX control must have the same Share Memory: Name and Share Memory: Size for the same application.

    Be careful when you change the Share Memory: Name and Share Memory: Size. Each time they are changed, a new Share Memory object with the new size is created. If prior to changing these settings, the application has already been launched (and the process is still alive), the application won't be able to access the new Share Memory object. Also, the current instance of an ActiveX Display session won' t be able to relaunch the application. Close the application before making changes to the Share Memory settings. Remember: each instance of the ActiveX control must have the same Share Memory: Name and Share Memory: Size for the same application.

  7. Enter a name in the Share Memory: Name box.

  8. Enter a value in the Share Memory: Size box.

    Note: Several instances of the ActiveX Display control can launch the same application. However, only one instance of the ActiveX Display control can write to the shared memory buffer at a time. The other instances of the ActiveX Display control have to wait until the application reads the memory buffer data before they can to write to the shared memory buffer.

    Several instances of the ActiveX Display control can launch the same application. However, only one instance of the ActiveX Display control can write to the shared memory buffer at a time. The other instances of the ActiveX Display control have to wait until the application reads the memory buffer data before they can to write to the shared memory buffer.

  9. Click Apply or OK to accept the current modifications.

Modifying your Display Color Properties

  1. Click the Colors tab to assign specific colors to host elements.

  2. Select the type of host element you want to modify from the Property Name drop-down list. The current color button for the selected element becomes highlighted.

  3. Select a color button from the available color buttons.

    Select an element from your system from the System Color drop-down list and apply its color to your host element. For example, if you used a light gray for your Application Workspace, apply the same color to the current selection in the Property Name drop-down list.

  4. Click Apply, OK, or select another property name to accept the current modification.

Note: If you select User Server Colors from the Appearance tab, the system erases any changes you make in this tab and uses the server default colors.

Modifying your Display Font Properties

  1. Click the Fonts tab to modify the font selection for each element.

  2. Select an element from the Property Name drop-down list.

  3. Select a font, font style, size, and effect to apply to the selected element. A sample of your font selection appears in the Sample panel.

Strikeout: applies a bar across the characters: Strikeout text

Underline: applies a bar under the characters: Underlined text

Enabling GUI Transform

The ActiveX Display control provides a GUI Transform feature that allows you to change the flat appearance of the traditional green screen to a GUI interface when you select this mode.

  1. Right-click on the ActiveX host display screen and select GUI Transform from the context-sensitive menu.

  2. Select one of the following options from the GUI Transform sub-menu.

Viewing your Keyboard Commands

Unless your keyboard is clearly marked, it's sometimes difficult to remember where all the 5250 commands and special keys are located. And with the Keyboard Editor, the traditional location of some of these commands and keys no longer apply.

Fortunately, the ActiveX control toolbar has the Keyboard Mapping dialog box. This dialog box allows you to see to which keys the 5250 keyboard functions and special keys are currently mapped.

To view your keyboard mapping of the 5250 functions, follow these steps:

  1. Click the Keyboard Mapping button on the ActiveX control Toolbar. The Keyboard Mapping dialog box opens.

  2. Select the type of keys you want to see.
  3. Select the type of command from the drop-down list in the Host Key panel. The current keyboard mapping appears in the Key Mapping box.

    Note: You cannot change the keyboard mapping from this dialog box. If you want to change the keyboard mapping, use the Keyboard Editor.

  4. If you want to launch the selected function right now, click the Execute button.

  5. Click the Close button when done.


 

HostFront Macro Support

The ActiveX display ActiveX control provides support for macros enabling users to record repetitive actions to replay them in one simple click.

The HostFront macros support advanced functionality made available by enabling the users to write and edit macros manually and using methods available in the ActiveX display control as well as standard VBScripts. The HostFront macros are editable in the standard NotePad available with any Windows OS.

For a list of supported commands from the Display ActiveX control, please refer to HostFront Specific Macro Commands.

For a list of the supported VBScripts, you can refer to any standard language reference.

Recording a Macro

To record a macro, click on the record button in the toolbar (). You will be prompted to enter a name and a description for the macro.

Note that macro names must start with a letter.

All macros files will be saved in one folder under the Documents and Setting/User/Application Data/Farabi Technology. Farabi macro files have a .VBS extension and each file will have one macro. The path and the file name will be displayed after you click the OK button for confirmation.

Once you enter a name and click OK, you can start recording your actions. The macro recorder records only keyboard strokes and not mouse clicks or toolbar button clicks. It will however record the Connect/Disconnect and Sign on actions done using the toolbar buttons. While recording, the following floating toolbar will be displayed:

The three buttons are: Stop, Pause and Insert.

The Stop buttons stops the recorder and saves the file. This should be used to finish recording.

The Pause button stops the recording temporarily and then resumes it when clicked again. This button works in conjunction with the Insert button also.

The Insert button is used to insert special advanced macro commands into the macro script. To use the Insert button, you should first Pause the macro then click on the Insert button. When you that, you get the following dialog box:

Using this dialog box, you can insert one of four commands into the macro scripts while recording it. These commands are: (for more details on the commands see the HostFront Specific Macro Commands section)

WaitforText

WaitforCursor

SetCursorPos

MsgBox (this is a VBScript command)

After you you configure the commands you want, click OK and then click the Pause button again and resume recording the macro.

Managing Macros

To manage your macros, click on the  button on the toolbar to open the Macros Management dialog box.

Run: Use this button to run the selected macro.

Edit: Use this button to edit the selected macro in NotePad. Changes to macros take effect immediately after saving the macro file provided that you do not change the macro name (the Sub name) inside the macro (this requires closing the browser and restarting the display session anew).

Delete: Use this button to delete the selected macro(s). This will delete the macro files.

Add to menu: Use this button to add the selected macro(s) to the quick access menu on the toolbar accessible through the button on the toolbar.

Remove from menu: Use this button to remove the selected macro(s) from the quick access menu if they are already added there.

Secondary macro folder: Using this folder you can get access to macros saved in any folder on your local machine or in a shared folder on the network. By default, this field is empty. You can select the folder you want by clicking the Browse button and selecting the folder you want. Macros from this folder will be marked with the (R) extension to their names (for Remote) to differentiate them from macros saved on the default local folder which will be marked with a (L) extension (for Local). All local and remote macros will be displayed in one list for easier access by the users.

 

Replaying a Macro

You can replay a macro in one of two ways:

  1. Using the Macro Management dialog box by clicking on the button and then selecting the required macro and clicking Run.

  2. Using the quick access menu accessible through the  toolbar and then selecting the required macro. You need first to add the macro to the quick access menu from the Macros Management dialog box.

Note that you should always start replaying the macro from exactly the same cursor position where you initially recorded it. Failing to do so will result in errors and might cause erroneous data entry. The macro does not verify its starting point by default unless you manually add some verification logic.

 

Notes

  1. Macros are saved under the following folder: C:\Documents and Settings\user\Application Data\Farabi Technology, and they have a .HFM extension.

  2. You can have only one macro per file. The macro name can differ from the filename.

  3. You cannot use the Connect command within a macro if you are using a persistent connection mode. You can use it with non-persistent connections.

 

HostFront Specific Macro Commands

Below is a list of all the HostFront specific macro commands. In addition to these, you can use standard VBScript commands. A reference for the latter can be downloaded from Microsoft's web site.

 

Connect

The Connect() method connects a user to a host session through HostFront Server.

Function Prototype

BOOL Connect(BSTR sUserName, BSTR sPassword)

This method attempts to allocate a new host session under the HostFront account defined by the given privileges.

Example

HFDISPLAY.Connect "GUEST", ""

In this example, the Connect() method attempts to allocate a new host session to the "Guest" account.

Note: Use this command only if you are authenticated to HostFront server using HostFront authentication. If you are using the other authentication methods (Windows domain, RSA), do not use it.

Disconnect

The Disconnect() method closes the current host session.

Function Prototype

BOOL Disconnect()

The Disconnect() method disconnects the session from the host before the script ends. You connect sessions using the Connect() method. This method returns one of the following:

  1. TRUE if the operation is successful
  2. FALSE if the operation is not successful

Example

HFDISPLAY.PushKey [PF3]

HFDISPLAY.Disconnect

In this example, the macro disconnects the active session after exiting (usually by PF3) the application.

 

GetBuildNoHF

This method returns the build number of the ActiveX control or the HostFront server depending on the parameter passed: a 0 returns the ActiveX control build number, a 1 return the HostFront server build number.

Function Prototype

STR GetBuildNoHF(boolean bServer)

Example

Version = HFDISPLAY.GetBuildNoHF(1)

Returns 20031003 for example

 

GetCursorColumnPos

The GetCursorColumnPos() method returns the column on which the cursor is currently positioned on the host screen.

Function Prototype

int GetCursorColumnPos();

Example

nCol = HFDISPLAY.GetCursorColumnPos();

 

GetCursorRowPos

The GetCursorRowPos() method returns the row on which the cursor is currently positioned on the host screen.

Function Prototype

int GetCursorRowPos();

Example

nRow = HFDISPLAY.GetCursorRowPos();

 

GetField

The GetField() method returns the data in the given field location on the host screen.

Function Prototype

BSTR GetField(int nRow, int nCol1, [int nCol2])

This method returns a string of the characters located at the field specified by nRow and nCol1 position. The information returns as a 32-bit character pointer (BSTR).

Example

SystName = HFDISPLAY.GetField(2, 70,-1)

In this example, the GetField() method returns the field starting at row 2 and column 70 till the end of the filed and stores it in the SystName variable.

UserName = HFDISPLAY.GetField(6, 20, 26)

In this example, the GetField() method returns the string at row 6 between columns 20 and 26 and stores it in the UserName variable.

 

GetFieldLength

The GetFieldLength() method returns the maximum length (in characters) of the field at given location on the current host screen.

Function Prototype

int GetFieldLength(int nRow, int nCol);

Example

nMaxLen = HFDISPLAY.GetFieldLength(2, 70);

 

GetHostScreenHeight

This method returns the screen height of the current screen.

Function Prototype

short GetHostScreenHeight()

Example

ScreenWidth = HFDISPLAY.GetHostScreenHeight()

 

GetHostScreenWidth

This method returns the screen width of the current screen.

Function Prototype

short GetHostScreenWidth()

Example

ScreenWidth = HFDISPLAY.GetHostScreenWidth() ()

 

GetRowData

The GetRowData() method returns the data from an entire row on the host screen.

Function Prototype

BSTR GetRowData(int nRow)

This method returns the information from a row identified by nRow. The information is returned as a 32-bit character pointer (BSTR).

Example

Row1 = HFDISPLAY.GetRowData(1)

In this example, the GetRowData() method returns all the characters on row 1 and stores them in the Row1 variable.

 

GetServerInfo

The GetServerInfo() method is used to retrieve active/configured session information from the server.

Function Prototype

long GetServerInfo (int nInfoType)

Example

nRet = HFDISPLAY.GetServerInfo (0)

 

nInfoType Returned Value

0 Server load as a percentage ( is calculated by multiplying the number of current sessions by 100 and dividing the product by the maximum number of concurrent sessions)

1 User load as a percentage ( is calculated by multiplying the number of users connected by 100 and dividing the product by the total number of users defined)

2 Maximum number of concurrent sessions

3 Number of sessions currently used

4 Total number of users defined in the server profile

5 Number of users currently connected

 

GetStatusLine

This method returns the text displayed in the status bar of the active screen.

Function Prototype

BSTR GetStatusLine()

Example

StausLineText = HFDISPLAY.GetStatusLine()

 

GetUserName

This method returns the user name used to sign on to HostFront server. The method returns the last user name used as stored in the profile file even if you are not currently signed on to the HostFront server.

Function Prototype

STR GetUserName();

Example

UserName = HFDISPLAY.GetUserName()

 

GetUserPassword

This method returns the password used to sign on to HostFront server. If you are not currently signed on to the HostFront server, the method returns an empty string.

Function Prototype

STR GetUserPassword();

Example

UserName = HFDISPLAY.GetUserPassword ()

 

GetVersionHF

This method returns the version number of the ActiveX control or the HostFront server.

Function Prototype

short GetVersionHF(boolean bServer)

 

If the parameter passed is a 0, the method returns the ActiveX control version number and if it was a 1, it returns the HostFront server version number.

Example

Version = HFDISPLAY.GetVersionHF(0)

Returns 695 for example (for a 6.9.5 release of the ActiveX Display control)

 

IsAlphaField

The IsAlphaField() method checks if the field at given location on the current host screen is accepting only letters and some separator characters.

Function Prototype

BOOL IsAlphaField(int nRow, int nCol);

Example

bRtn = HFDISPLAY.IsAlphaField(6, 53);

 

IsConnected

The IsConnected() method checks if the session is currently connected to a the host.

Function Prototype

BOOL IsConnected()

Example

if HFDISPLAY.isconnected()= FALSE then HFDISPLAY.Connect "Guest", "farabi"

 

IsEditableField

The IsEditableField() method checks if the field at given location on the current host screen is editable or not.

Function Prototype

BOOL IsEditableField(int nRow, int nCol);

Example

bRtn = HFDISPLAY.IsEditableField(6, 53);

 

IsKbdLocked

The IsKbdLocked() method checks to see if the keyboard is locked (input inhibited). The host will lock the keyboard when it is processing data or when there is an error such as when numeric data is entered into a text-only field.

Function Prototype

BOOL IsKbdLocked()

This method returns one of the following:

  1. TRUE if the keyboard is locked
  2. FALSE if the keyboard is not locked

Example

bRtn = HFDISPLAY.IsKbdLocked()

 

IsNonDisplayField

The IsNonDisplayField() method checks if the field at given location on the current host screen is protected (i.e. used to input a host password).

Function Prototype

BOOL IsNonDisplayField(int nRow, int nCol);

Example

bRtn = HFDISPLAY.IsNonDisplayField(7, 53);

 

IsNumericField

The IsNumericField() method checks if the field at given location on the current host screen is a numeric field. Data in a numeric fields can include digits and some separator characters such as /,+,- and space. For details on valid data on numeric fields please check the appropriate IBM documentation.

Function Prototype

BOOL IsNumericField(int nRow, int nCol);

Example

bRtn = HFDISPLAY.IsNumericField(6, 53);

 

IsReverseField

The IsReverseField() method reverses the background and foreground colors of a host screen field. For example, if the background is white and the foreground is black, then the background becomes black and the foreground becomes white.

Function Prototype

BOOL IsReverseField (int nRow, int nCol) ;

Example

bRtn = HFDISPLAY.IsReverseField (7, 53);

 

PrintDisplayScreen

The PrintDisplayScreen() method performs a print screen function to the specified printer. It is equivalent to the Print Screen button on the toolbar. It has two parameters, one to define whether or not to print the header and footer information, and the second to define the target printer.

Function Prototype

BOOL PrintDisplayScreen (int HeaderFooter, Str PrinterPath) ;

Parameters

HeaderFooter:

0 : Print the header and footer

1 : Do not print the header and footer

PrinterPath:

The string defining the printer path. It must be enclosed between double quotes. If left empty (""), the printing will be directed to the default printer.

    

Example

HFDISPLAY.PrintDisplayScreen 0, "\\printer\HP6"

 

PushKey

The PushKey() method simulates a key input.

Function Prototype

BOOL PushKey(int nKey)

The PushKey() method is used to simulate a single key input to the host. A key is referred to by name. This method returns one of the following:

  1. TRUE if the operation is successful
  2. FALSE if the operation is not successful

The available keys are listed below (for both 5250 and 3270 together):

Attention

Field_Base

Page_Down

PF19

Auto_Reverse

Field_Exit

Page_Up

PF20

Backspace

Field_Mark

PF1

PF21

BackTab

Field_Minus

PF2

PF22

Base

Field_Plus

PF3

PF23

Calc_Rev_Mode

FieldX

PF4

PF24

Clear

Help

PF5

Print

Cursor_Down

Hex_Mode

PF6

Reload

Cursor_Left

Home

PF7

Reset

Cursor_Right

Insert

PF8

Reverse_Push

Cursor_Selection

Latin

PF9

Screen_Direction

Cursor_Up

LightPen_Selection

PF10

System_Request

Delete_Char

NewLine

PF11

Tab

Double_Left

NumPad_Comma

PF12

Test_Request

Double_Right

NumPad_Dot

PF13

Toggle_RDE_RTE

Dup

NumPad_Slash

PF14

 

End

NumPad_Star

PF15

 

Enter

PA1

PF16

 

Erase_EOF

PA2

PF17

 

Erase_Input

PA3

PF18

 

 

Example

HFDISPLAY.PutField 6, 53, UserName

HFDISPLAY.PutField 7, 53, Password

HFDISPLAY.PushKey [ENTER]

In this example, the PushKey() method sends the [Enter] key to the host after the user provides a user name and password. An alternative to PushKey [ENTER] is as follows:

HFDISPLAY.PushKey 32778

The numeric code for the [Enter] key is 0x800A in hexadecimal or 32778 in decimal.

 

PushKeyStream

The PushKeyStream method simulates keystrokes on the keyboard with letters, numbers and function keys used on one screen all listed one after the other.

Function Prototype

HFDISPLAY.PushKeyStream "string<special key>"

Special keys should always be enclosed between <>. Normal text is typed as is. The whole stream will be enclosed between two double quotes.

This is the list of supported special keys that can be used by name:

Attention

Field_Base

Page_Down

PF19

Auto_Reverse

Field_Exit

Page_Up

PF20

Backspace

Field_Mark

PF1

PF21

BackTab

Field_Minus

PF2

PF22

Base

Field_Plus

PF3

PF23

Calc_Rev_Mode

FieldX

PF4

PF24

Clear

Help

PF5

Print

Cursor_Down

Hex_Mode

PF6

Reload

Cursor_Left

Home

PF7

Reset

Cursor_Right

Insert

PF8

Reverse_Push

Cursor_Selection

Latin

PF9

Screen_Direction

Cursor_Up

LightPen_Selection

PF10

System_Request

Delete_Char

NewLine

PF11

Tab

Double_Left

NumPad_Comma

PF12

Test_Request

Double_Right

NumPad_Dot

PF13

Toggle_RDE_RTE

Dup

NumPad_Slash

PF14

 

End

NumPad_Star

PF15

 

Enter

PA1

PF16

 

Erase_EOF

PA2

PF17

 

Erase_Input

PA3

PF18

 

 

Example

HFDISPLAY.PushKeyStream “GUEST<TAB>FARABI<ENTER>”

This macro assumes the cursor is at the correct position where the username should be entered and that the password field is one TAB move away.  In this example we used values directly. In order to use variables, you need to separate the variables from the other keys using simple concatenation as in the following example:

 

HFDISPLAY.PushKeyStream Username+”<TAB>”+Password+”<ENTER>”

 

PutField

The PutField() method fills fields with data on the host screen.

Function Prototype

BOOL PutField(int nRow, int nCol1, VARIANT vtData)

This method places a constant, or the value of the variable, in the field starting at the specified row and column. This method returns one of the following:

  1. TRUE if the operation is successful
  2. FALSE if the operation is not successful

When using PutField() methods on a host screen, the PushKey(ENTER) method validates your entries and moves on to the next screen.

You can use (-1) for the row and column to have the data entered at the current field.

Example

HFDISPLAY.PutField 6, 53,“UserName”

HFDISPLAY.PutField 7, 53, “Password”

HFDISPLAY.PushKey [ENTER]

In this example, the PutField() method enters the values UserName and Password in the user name and password fields of a host sign on screen.

Using the -1 parameter, the example becomes as shown below. This however assumes the cursor is currently at the correct field location where the username should be entered and the password field is the next one (after one Tab move).

HFDISPLAY.PutField -1, -1, “UserName”

HFDISPLAY.PushKey [TAB]

HFDISPLAY.PutField -1,-1, “Password”

HFDISPLAY.PushKey [ENTER]

 

SetCursorPos

The SetCursorPos() method places the cursor on the host screen at a specified position.

Function Prototype

BOOL SetCursorPos(int nRow, int nCol)

This method places the cursor at the specific row and column. In some host applications, you may need to position the cursor at a specific location on the host screen before issuing a PushKey() method. This method returns one of the following:

  1. TRUE if the operation is successful
  2. FALSE if the operation is not successful

Example

HFDISPLAY.SetCursorPos 20 , 7

HFDISPLAY.PushKey [PF3]

In this example, the cursor is placed at row position 20 and column 7 before the [PF3] key is sent to the host application.

 

SignOn

This method is used to sign on to HostFront with the given user name and password.

Function Prototype

boolean SignOn(BSTR sUserName, BSTR sUserPassword)

Example

SignonSuccessful = HFDISPLAY.SignOn(“Visitor”,”Farabi”)

Note: Use this command only if you are authenticated to HostFront server using HostFront authentication. If you are using the other authentication methods (Windows domain, RSA), do not use it.

 

WaitForCursor

This method causes the macro to be suspended until the cursor is at a specified location on the active screen.

If you want to specify a column only use the value -1 for the row (and vice-versa).

Function Prototype

void WaitForCursor (int nRow, int nColumn) ;

Example

HFDISPLAY.WaitForCursor 4,35

 

WaitForText

This method causes the macro to be suspended until the specified text is entered at the specified location.

Value -1 can be used for both nRow and nColumn meaning that the text can be anywhere on the active screen.

Function Prototype

void WaitForText (string szText , int nRow, int nColumn)

Example

HFDISPLAY.WaitForText “Montreal”, -1,-1