General class library reference
HostFront's COM Toolkit include the components mentioned below.
Table 11: HostFront COM general class library
Name of component Sub-components
COM Components
HostLink
Enumerators
FTP
IND$FILE
FTP
APPC
XML XMLDoc Class
HostLink class library reference
Below is a summary of all the HostLink Class Library Reference available for COM in HostFront 5.0
Table 12: HostFront COM HostLink class library
HostLink class for COM components
AttachEx (String)
CheckField (String,Int,Int,Int,Int)
Connect (String,String)
ConnectDirect (String,Int,String,String)
CreateXMLObj (String)
CreateFT3270Obj()
Detach()
Disconnect()
EnableDebugging (Int)
GetAccountInfo (String,Object, Object)
GetClientSessions (Ref Object,String, String)
GetCursorColumn()
GetCursorRow()
GetErrorMsg()
GetField (Int,Int,Int)
GetAttribute (Int, Int)
GetFieldEx (Int,Int,Int,Int)
GetFieldLength (Int,Int)
GetFieldStart()
GetHostInfo()
GetLanguageId()
GetObjectModeType()
GetRow()
GetScreen()
GetScreenHeight()
GetScreenWidth()
GetServerInfo (HFPLib.ENUM_SERVER_INFO_QUERY)
GetSessionID()
GetSessionStatus (String,String,Int)
GetVersion()
IsAlphaField()
IsConnected()
IsEditableField (Int,Int)
IsKbdLocked()
IsModeASCII()
IsModeRDE()
IsNonDisplayField (Int,Int)
IsNumericDistinction()
IsNumericField()
IsReverseField()
IsRightToLeft()
PushKey (Int)
PutField (Object,Int,Int)
PutFieldEx (Object,Int,Int,Int)
SetArabicMode (Int,Int)
SetCGIName (String)
SetClusterHTTP (String,String)
SetCursor (Int,Int)
SetDelay (Int)
SetHTTPPort (Int)
SetIPAddress (Object)
SetObjectModeType (HFPLib_ENUM_OBJECT_TYPE_String)
SetServerVersion (Int)
SetReference (Int,Int)
SetSSL (int)
SetTargetEmulation (HFPLib_ENUM_EMULATION)
UseHFEE (Int)
UseSessionLoadBalancing (Int)
Methods
The following methods are associated with the HostLink class for COM components.
AttachEx (String)
The AttachEx() allows you to associate this ActiveX object with a device name and not to a specific session identification string previously retrieved with the GetHostInfo() method. This method is to be used instead of Connect() when the host session is known to be still connected and the session info string is available.
Prototype
PUBLIC SYSTEM.BOOLEAN AttachEx(BSTR sSessionInfo)
This method returns one of the following:
•  TRUE if the user is bound to the host session
•  FALSE if the operation is not successful
sSessionInfo is returned by the GetSessionID() method.
Example
bRtn = AttachEx(BSTR sSessionInfo)
Also see VB6_App sample
Note
To attach a newly created object to an existing session, some initializations have to be done by calling the following:
•  SetObjectModeType (CCO or SCO, server to connect). For HostFront 403, you must use CCO.
•  SetTargetEmulation (5250 or 3270);
•  SetServerVersion (403 or lower, to know if the object needs to read Intermediate Screen byte).
CheckField (String,Int,Int,Int,Int)
The CheckField() method confirms that a specific string of data exists at a specific location on the host screen.
Prototype
Bool CheckField(BSTR sData, int nRow, int nCol1, int nCol2)
•  The nRow and nCol1 identify the row and column where the data starts.
•  The nCol2 is optional. By specifying nCol2 as greater than zero, the method checks the host screen string either from Col1 to Col2 or to the end of the field, whichever is shorter.
•  The sData is a string. The CheckField() method compares sData with a string that appears on the current host screen at position nCol1 to nCol2.
If the text is not present, the CheckField() method waits up to 6 seconds before acknowledging tht the screen did not appear. This method returns one of the following:
•  TRUE: if the operation is successful and the script can continue
•  FALSE: if the operation is not successful and the script terminates
Note
You can use the SetDelay() method to define the waiting time.
Example
bRtn = CheckField("Sign", 1, 35)
In this example, the CheckField() method checks to see that the field at row 1 and column 35 contains the string 'Sign'.
Connect (String,String)
The Connect() method connects a user to a host session through HostFront Server.
Prototype
PUBLIC SYSTEM.BOOLEAN Connect (BSTR sUserName, BSTR sPassword)
This method attempts to allocate a new host session under the HostFront account defined by the given privileges.
•  If parameter sUserName is null, the target account becomes the default Host Application Integration Toolkit account (usually a "Guest" account).
•  To disconnect the allocated session, you should call Disconnect(). You must call Connect() before using any other method. This method returns one of the following:
♦  TRUE if the operation is successful
♦  FALSE if the operation is not successful
Parameters
BSTR sUserName: The name of the HostFront account used to establish a session.
BSTR sPassword: The password associated with the HostFront account.
Example
bRtn = Connect ("GUEST", "")
In this example, the Connect() method attempts to allocate a new host session to the "Guest" account.
ConnectDirect (String,Int,String,String)
This method is to be used with HostFront servers that have a version < 3.6.0. It is not supported with the new architecture.
The ConnectDirect() method connects a user to a host session through HostFront Server, using a TCP/IP connection only. It skips the Signon HTTP request sent before any connection to retrieve information from the HostFront server. Hence the developer has to know the value of the listening port used by the HostFront server.
Prototype
BOOLEAN ConnectDirect (BSTR HostFrontAddress, int nPort, BSTR sUserName, BSTR sPassword)
This method attempts to allocate a new host session under the HostFront account defined by the given privileges.
•  If parameter sUserName is null, the target account becomes the default Host Application Integration Toolkit account (usually a "Guest" account).
•  To disconnect the allocated session, you should call Disconnect(). You must call ConnectDirect() before using any other method. This method returns one of the following:
♦  TRUE if the operation is successful
♦  FALSE if the operation is not successful
Parameters
BSTR HostFrontAddess: IP address or DNS Name of the HostFront server.
int nPort: Listening port used by the HostFront server.
BSTR sUserName: The name of the HostFront account used to establish a session.
BSTR sPassword: The password associated with the HostFront account.
Example
bRtn = ConnectDirect(192.168.1.200,2000,"GUEST", "")
In this example, the ConnectDirect() method attempts to allocate a new host session to the "Guest" account by using the HostFront server located at address 192.168.1.200 and listening on port 2000.
CreateXMLObj (String)
The CreateXMLDoc method creates the XMLDoc component. From there, the client can then work this component with the methods within.
For details, see the XMLDoc Class.
Parameters
bstrRootName: Name of root tag within XML file. Returns a pointer to an XML interface.
CreateFT3270Object()
This method creates the FT3270obj Component. From there, the client can then work this component with the methods within. It returns a pointer to the IFT3270 interface or NULL on failure. The new FT3270Obj has 19 properties and 2 methods. All properties (except XferStatus) are write-only.
For details, see File Transfer Automation with 3270.
Detach()
The Detach() method allows you to disconnect this ActiveX object from HostFront Server only. The client session will still be alive on the host.
Prototype
PUBLIC SYSTEM.BOOLEAN Detach()
This method returns the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
Example
bRtn = Detach()
Disconnect()
The Disconnect() method closes the current host session.
Prototype
PUBLIC SYSTEM.BOOLEAN 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:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
Example
bRtn = PushKey(PF3)
bRtn = Disconnect()
In this example, the Disconnect() method appears immediately after the script signs off. In this case, the script sends the [PF3] command function to the host.
EnableDebugging (Int bEnable)
Enables/Disables the debugging mode. If TRUE execution messages will be sending to the debugging window.
Prototype
EnableDebugging(bEnable As Long) As Long
Parameters
bEnable..................: FALSE/TRUE: disable/enable debugging
pRetVal..................: TRUE successful, False otherwise
GetAccountInfo (String,Object, Object)
The GetAccountInfo() method returns the session information about a specified account. The information returned is the Maximum number of available sessions this particular client has for Display, Print and File Transfer, as well as the number of connected clients for each type of session.
This is to be used with versions prior to 3.6.0 only.
Prototype
PUBLIC SYSTEM.BOOLEAN GetAccountInfo(BSTR AccountName ,
long ConnectedSessions[3],
long MaxSessions[3])
Parameters
BSTR AccountName()
The name of the account you want information about long ConnectedSessions[3]
An array of 3 longs that returns the number of connected sessions (per type) long MaxSessions[3]
An array of 3 longs that returns the number of allowed sessions (per type)
Example
long ConnectedSessions[3]: Returns in this array the number of connected sessions for this account
ConnectedSessions[0]: for Display Sessions
[1]: for Printer Sessions
[2]: for File Transfer Sessions
long MaxSessions[3]: Returns in this array the maximum number of allowed sessions for this account
MaxSessions[0]: for Display Sessions
[1]: for Printer Sessions
[2]: for File Transfer Sessions
This Method has a Public System.Booleanean return value, which is:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
Heres a sample code written in Visual Basic:
Dim Connected(0 To 2) As Long 
Dim MaxSessions(0 To 2) As Long 
Dim bRet as Public System.Booleanean 
BRet=HostLink.GetAccountInfo ("guest, Connected, MaxSessions) 
GetClientSessions (Ref Object,String, String)
The GetClientSessions() method retrieves the number of sessions configured for a particular client.
This is to be used with versions prior to 3.6.0 only.
Prototype
Int GetClientSessions (VARIANT() pvSessionsList,
String bstrUserName,
String bstrUserPassword)
GetCursorColumn()
The GetCursorColumn() method returns the column number on which the cursor is currently positioned on the host screen.
Prototype
int GetCursorColumn();
Example
nCol = GetCursorColumn();
GetCursorRow()
The GetCursorRow() method returns the row number on which the cursor is currently positioned on the host screen.
Prototype
int GetCursorRow();
Example
nRow = GetCursorRow();
GetErrorMsg()
The GetErrorMsg() method returns an explanation string for the error that occurred on the last execution. If there is no error, the returned string is empty.
Prototype
BSTR GetErrorMsg()
GetField (Int,Int,Int)
The GetField() method returns information from a given location on the host screen.
Prototype
BSTR GetField(int nRow, int nCol1, [int nCol2])
This method returns a string of the characters located at a specified screen position identified by nRow and nCol1. The information returns as a 32-bit character pointer (BSTR).
The nCol2 is optional. By specifying nCol2 as greater than zero, the GetField() method returns the information until it reaches the second column or the end of the field, whichever is shorter.
Example
SystName = GetField(2, 70)
In this example, the GetField() method returns the field starting at row 2 and column 70 and stores it in the SystName variable.
UserName = 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.
GetAttribute (Int, Int)
This method retrieves the attributes of a specified field at (nRow, nCol).
Prototype
long GetFieldAttribute(int nRow, int nCol)
Parameter
(int nRow, int nCol) Position of the field
Return
Long: a vlaue containing the field attributes. Each bit of thsi value represents a field attribute as described in the table below (Bit 0 is the least significant bit: LSB)
Status flag bits
Bit # Description
0 Auto skip
1 Column separator
2 Mandatory fill
3 Zero fill
4 Blank fill
5 Mandatory enter
6 Field exit
7 Auto enter
8 Reverse video
9 Reserved
10 Upper case
11 Alphabetic only
12 Signed numeric
13 Numeric only
14 Digits only
15 Alpha numeric
16 Colour (blue component)
17 Color (green component)
18 Color (red component)
19 Blinking
20 Underlined
21 High intensity
22 Protected
23 Read only
Remaining bits Reserved
GetFieldEx (Int,Int,Int,Int)
The GetFieldEx() method returns information from a given location on the host screen.
Prototype
BSTR GetFieldEx (int nRow, int nCol1, int nCol2, UINT nFlag)
This method returns a string of the characters located at a specified screen position identified by nRow and nCol1. The information returns as a 32-bit character pointer (BSTR)
•  This nCol2 and nFlag are option. By specifying nCol2 as greater than zero, the GetField() method returns the information until it reaches the second column or the end of the field, whichever is shorter. The nCol2 element is zero by default, which returns the entire field string.
•  The nFlag can have the values HFP_ARABIC, HFP_REVERSE or both. The nFlag element is zero by default, which means that the data is not translated.
29: The HFP_ARABIC flag forces a translation of the returned data from Latin to Arabic.
30: The HFP_REVERSE flag reverses the returned data.
Examples
SystName = GetFieldEx(2, 70). The GetFieldEx() method returns the field starting at row 2 and column 70 and stores the results in the SystName variable UserName = GetFieldEx(6, 20, 26). The GetFieldEx() method returns the string at row 6 between columns 20 and 25 and stores the result in the UserName variable FLAG = HFP_Arabic OR HFP_REVERSE
The GetFieldEx() method performs the following:
UserName = GetFieldEx(6, 20, 26 FLAG)
•  get the string at row 6 between columns 20 and 26
•  translates the string from Latin to Arabic
•  stores the result in the UserName variable
UserName = GetFieldEx(6, 20,26, HFP_ARABIC)
This GetFieldex() method translates the string from Latin to Arabic
GetFieldLength (Int,Int)
The GetFieldLength() method returns the maximum length (in characters) of the field at given location on the current host screen.
Prototype
int GetFieldLength(int nRow, int nCol);
Example
nMaxLen = GetFieldLength(2, 70);
GetFieldStart()
The GetFieldStart() method returns the position of the starting column for the field at given location on the current host screen.
Prototype
int GetFieldStart(int nRow, int nCol);
Example
nCol = GetFieldStart(2, 70);
GetHostInfo()
The GetHostInfo() method retrieves the information about the currently connected session. That information includes the data stream type (5250 or 3270) and the node name. The node name is the LU name in 3270 mode, and the Pair Host name/Device name in 5250 mode. The information string is formatted as follows:
5250: "[DS5250][Local LU][Host Name][Device Name]"
TN5250: "[TN5250][Host Name][Device Name]"
3270: "[DS3270 ][LU Name]"
TN3270: "[TN3270 ][HostName][LU Name]"
Prototype
BSTR GetHostInfo()
GetLanguageId()
The GetLanguageId() method retrieves the default language of the object. The language refers to both the ANSI code page (on the client side) and the EBCDIC code page (on the host side).
Prototype
long GetLanguageId (int nlang)
Example
nRet = GetLanguageId (nLang)
Language int Language int
NOT DEFINED 0 ITALIAN 1
CANADIAN FRENCH 2 MULTINATIONAL 3
ENGLISH UK 4 FRENCH AZERTY 5
DANISH 6 FINNISH 7
GERMAN 8 NORWEGIAN 9
SPANISH 10 SPANISH SPEAK 11
PORTUGUESE 12 SWEDISH 13
ENGLISH US 14 ARABIC 15
GetObjectModeType()
The GetObjectModeType method retrieves the type of connectivity provided by the object.
Prototype
long GetObjectModeType
Example
nRtn = GetObjectModeType
GetRow()
The GetRow() method returns the data from an entire row on the host screen.
Prototype
BSTR GetRow(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 = GetRow(1)
In this example, the GetRow() method returns all the characters on row 1 and stores them in the Row1 variable.
GetScreen()
Returns the screen content in a string.
Prototype
BSTR GetScreen ()
Return
Returns a string containing the screen content as text.
GetScreenHeight()
The GetScreenHeight() method counts the total number of lines in the current host screen (that is, the screen height in characters).
Prototype
int GetScreenHeight()
This method returns zero (0) if the operation is not successful.
Example
nHeight = GetScreenHeight()
GetScreenWidth()
The GetScreenWidth() method returns the maximum number of characters that you can place on a single line of the current host screen (that is, the screen width in characters).
Prototype
int GetScreenWidth()
This method returns zero (0) if the operation is not successful.
Example
nWidth = GetScreenWidth()
GetServerInfo (HFPLib.ENUM_SERVER_INFO_QUERY)
The GetServerInfo() method is used to retrieve active/configured session information from the server.
Prototype
long GetServerInfor (int nInfoType)
Example
nRet = GetServerInfor (nInfoType)
nInfoType Returned Value0 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
GetSessionID()
The GetSessionID() method returns the session signature string (or ID). While the host session is not disconnected, the session ID could be used to reattach a client to it.
Prototype
BSTR GetSessionID()
Example
Let's suppose that the ActiveX object appears as HfpObject in an Active Server Page. At the end of the ASP script execution, the host session is not disconnected (the method Disconnect() is not called).
If the session signature string is returned as follows: Session("SessID") = HfpObject.GetSessionID()
The code below (in the returned page) could reattach the session that is already connected to the host using an HTML emulation mode:
<FORM METHOD="POST" ACTION="/HFCGI/HFCGI.EXE/<%=Session("SessID")%>">
<INPUT NAME="Reload" TYPE="IMAGE" BORDER=0 SRC="/HFHTML/Reload.GIF">
</FORM>
GetSessionStatus (String,String,Int)
Returns the status of the session.
Prototype
BSTR GetSessionStatus( [in] BSTR SessionID, [in, optional] BSTR ServerName, [in, optional] int nHFPort)
Parameters
BSTR SessionID: The HostFront session ID
BSTR ServerName: The HostFront server IP address or server name
int nHFPort: The HostFront server persistent port
GetVersion()
The GetVersion() method returns the version and the build number of the object. This object should be a string formatted as follows: version-build number.
Prototype
BSTR GetVersion()
IsAlphaField()
The IsAlphaField() method checks if the field at given location on the current host screen is accepting only letters and some separator characters.
Prototype
PUBLIC SYSTEM.BOOLEAN IsAlphaField(int nRow, int nCol);
Example
bRtn = IsAlphaField(6, 53);
IsConnected()
The IsConnected() method checks if the object is currently connected to a host session.
Prototype
PUBLIC SYSTEM.BOOLEAN IsConnected()
IsEditableField (Int,Int)
The IsEditableField() method checks if the field at given location on the current host screen is editable or not.
Prototype
PUBLIC SYSTEM.BOOLEAN IsEditableField(int nRow, int nCol);
Example
bRtn = 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.
Prototype
PUBLIC SYSTEM.BOOLEAN IsKbdLocked()
This method returns one of the following:
•  TRUE if the keyboard is locked
•  FALSE if the keyboard is not locked
Example
bRtn = IsKbdLocked
IsModeASCII()
The IsModeASCII() ,method defines how data is exchanged between the object and the user application. The data string format can be set to ASCII or ANSI format.
Prototype
BOOL IsModeASCII()
Parameter
The data returns the following:
•  41. TRUE: if the data string is ANSI
•  42. FALSE: if the data string is ASCII
Example
bRtn IsModeASCII()
IsModeRDE()
This method retrieves the mode of the data entry operation for an Arabic language session.
Prototype
BOOL IsModeRDE()
This method returns one of the following:
•  27. TRUE when the operation is set to RDE mode
•  28. FALSE when the operation is set to RTE mode
Example
bRtn - BOOL Os<pdeRDE()
In this example, a true or false value will be returned. Normally, any text or data is entered from left to right as the cursor moves rightward. However, when the test is entered in reverse mode, it appears as a mirror image of the text in normal mode.
In RTE mode, the cursor does not change place. The cursor remains flush left. Text is pushed to the right as it is entered at the cursor position in reverse mode.
Text in Normal mode Text in RTE mode
Welcome to Rio! !oiR ot emocleW
In RDE mode, the cursor appears automatically at the end (flush right) of the current field or line. The cursor moves from right to left as the text is entered in reverse mode.
Text in Normal mode Text in RDE mode
Welcome to Rio! !oiR ot emocleW
IsNonDisplayField (Int,Int)
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).
Prototype
PUBLIC SYSTEM.BOOLEAN IsNonDisplayField(int nRow, int nCol);
Example
bRtn = IsNonDisplayField(7, 53);
IsNumericDistinction()
This method defines the numeric distinction mode of your current host session. The host session is converted from Hindi numerals to Arabic and vice versa.
Prototype
BOOL IsNumericDistrinction
Example
bRtn = IsNumericDistinction
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.
Prototype
PUBLIC SYSTEM.BOOLEAN IsNumericField(int nRow, int nCol);
Example
bRtn = 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.
Prototype
PUBLIC SYSTEM.BOOLEAN IsReverseField (int nRow, int nCol) ;
Example
bRtn = IsReverseField (7, 53);
IsRightToLeft()
The IsRightToLet method reverses the direction of the data entry in a host field from let to right.
Prototype
BOOL IsRightToLeft
Example
bRtn = IsRightToLeft
IsSSL
Retuns whether the HTTP connection uses SSL or not.
Prototype
BOOLEAN IsSSL ()
This method returns one of the following:
•  TRUE if SSL is used with the HTTP connection
•  FALSE if not
LightPenClick (Int,Int)
Simulate a light pen click at a certain row/column position.
Prototype
long LightPenClick([in] int nRow, [in] int nCol);
PushKey (Int)
The PushKey() method simulates a key input.
Prototype
PUBLIC SYSTEM.BOOLEAN 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:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
The available keys are listed below (with their associated numeric code in hexadecimal):
Keys common between 3270 and 5250
ATTN Attention 0x8201
RESETKY Reset 0x820A
CLRKEY Clear screen 0x8007
DUP Duplicate 0x8242
ENTER Enter 0x800A
ERASEIN Erase in 0x8204
ERASEOF Erase end of field 0x8206
PF1–PF24 Program function 1 to 24 0x8020 0x8037
SYSREQ System request 0x8008
3270 only keys
PA1–PA3 Program attention 1 to 3 0x8001 0x8003
5250 only keys
TSTREQ Test request 0x8009
PGUP Page up 0x824F
PHDN Page down 0x8250
FIELDEXIT Field exit 0x825C
FIELDPLUS Field plus 0x825D
FIELDMINUS Field minus 0x825E
Example
bRtn = PutField(UserName, 6, 53)
bRtn = PutField(Password, 7, 53)
bRtn = 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:
bRtn = PushKey(32778)

The numeric code for the [Enter] key is 0x800A in hexadecimal or 32778 in decimal.
PutField (Object,Int,Int)
The PutField() method fills fields with data on the host screen.
Prototype
PUBLIC SYSTEM.BOOLEAN PutField(VARIANT vtData, int nRow, [int nCol1])
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:
•  TRUE if the operation is successful
•  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.
Example
bRtn = PutField(UserName, 6, 53)
bRtn = PutField(Password, 7, 53)
bRTn = PushKey(ENTER)

In this example, the PutField() method enters the value of the user name and password variables in the user name and password fields of a host sign on screen.
PutFieldEx (Object,Int,Int,Int)
The PutFieldEx() method fills fields with data on the host screen.
Prototype
BOOL PutFieldEx(VARIANT vtData, int nRow, int nCol1, UINT nFlag)
This method places a constant or the value of the variable in the field starting at the specified row and column.
•  The nFlag can have the values HFP_ARABIC, HFP_REVERSE or both. The nFlag elements is zero by default, which means that the data is not translated. 31. The HFP_ARABIC flag forces a translation of the data from Arabic to Latin. 32. The HFP_REVERSE flag reverses the data
•  This method returns:
♦  33. TRUE if the operation is successful
♦  34. FALSE if the operation is unsuccessful
•  When you use the PutFieldEX() method on a host screen, the PushKey(ENTER) method validates your entries and moves on to the next screen.
Example
BRtn = PutFieldEx(UserName, 6, 53)
The PutFieldEx() method enters the values of the user name and password variables in the user name and password fields of a host sign-on screen.
BRtn = PutFieldEx(Password, 7, 53)
BRTn = PushKey(ENTER)
FLAG = HFP_ARABIC OR HFP_LATIN
BRtn = PutFieldEx(data, 1, 5, FLAG)

The PutFieldEx() method performs the following:
•  translates the Arabic string from Arabic to Latin
•  reverses it
•  inserts the results at tow 1, column 5 of the current screen.
SetArabicMode (Int,Int)
This SetArabicMode() method defines whether or not you will use numeric distinction and whether or not you will use RDE or RTE mode.
Prototype
BOOL SetArabicMode(BOOL bNumberDistinction, BOOL bRDE)
Example
bRtn - SetArabicMode(True, False)
This example will set the numeric distinction mode of the current host session to Arabic numerals from Hindi numerals and the data entry operation will be set to RTE mode.
Note
Numeric Distinction converts Arabic numbers to Latin numbers (Hindi for the Arabic language layer, Arabic for the Latin language layer) when the language mode changes. Normally, any text or data is entered from left to right as the cursor moves rightward. However, when the test is entered in reverse mode, it appears as a mirror image of the text in normal mode.
In RTE mode, the cursor does not change place. The cursor remains flush left. Text is pushed to the right as it is entered at the cursor position in reverse mode.
Text in Normal mode Text in RTE mode
Welcome to Rio! !oiR ot emocleW
In RDE mode, the cursor appears automatically at the end (flush right) of the current field or line. The cursor moves from right to left as the text is entered in reverse mode.
Text in Normal mode Text in RDE mode
Welcome to Rio! !oiR ot emocleW
SetCGIName (String)
Defines the name of the CGI used by the WEB server of the HostFront box.
Prototype
BOOLEAN SetCGIName (BSTR bstrCgiName)
bstrCgiName
Name of the CGI invoked by the WEB server (HfCgi.dll for ISAPI or HfCgi.exe. The default is HfCgi.exe
This method returns one of the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
SetClusterHTTP (String,String)
Defines the HTTP parameters used to connect to the Cluster service.
Prototype
PUBLIC BOOLEAN SetClusterHTTP (BSTR bstrCgiName, BSTR bstrVirtualFolder)
bstrCgiName
Name of the CGI invoked by the WEB server (HfCluster.dll for ISAPI or HfCluster.exe. The default is HfCluster.exe
bstrVirtualFolder
Name of the virtual folder containing the CGI for the cluster. The default value is HfCluster This method returns one of the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
SetCursor (Int,Int)
The SetCursor() method places the cursor on the host screen.
Prototype
PUBLIC SYSTEM.BOOLEAN SetCursor(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:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
Example
bRtn = SetCursor(20 , 7)
bRtn = 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.
SetDelay (Int)
The SetDelay() method defines an additional amount of time that the HostFront server will wait before validating a new host screen as ready to use.
Prototype
BOOL SetDelay(long int nTime)
The time delay is measured in milliseconds. This method returns one of the following:
•  47. TRUE if the operation is successful
•  48. FALSE if the operation is not successful
Example
SetDelay(120000)
PushKey(Enter)
PushKey(PFI)
SetDelay(0)

In this example, the time delay is set to 2 minutes. Then the time delay is reset to its default value using the SetDelay(0) method.
SetHTTPPort (Int)
The SetHTTPPort () method defines the HTTP (or HTTPS) port used by the WEB server running on the same box as the cluster service (or HostFront service for versions < 3.6.0)
This method has to be called AFTER the SetObjectModeType method whether for HTTP of TCP/IP mode. The default value of the HTTP port is 80. The HTTP port is needed because even in TCP/IP mode, the first request is a HTTP request sent to retrieve parameters from the cluster server and among them is the TCP/IP port number.
Prototype
PUBLIC SYSTEM.BOOLEAN SetHTTPPort(int nPort)
Example
bRtn = SetHTTPPort (80)
SetIPAddress (Object)
The SEtIpAddress() method defines the client's IP address within the object. The IP address is then reported to the HostFront Server.
Prototype
BOOL SetIPAddress(VARIANT vtAddress)
Example
Let us suppose that the ActiveX object appears as HfpObject in an Active Server Page. The following code defines the IP address to be passed to the server.
IPAddress = Request.ServerVariables("REMOTE_ADDR") HfpObject.SetIPAddress(IPAddress)
SetObjectModeType (HFPLib_ENUM_OBJECT_TYPE_String)
The SetObjectModeType() method defines the type of connectivity provided by of the object.
Even in TCP/IP mode, the first request is a HTTP request sent to retrieve parameters from the cluster server and among them is the TCP/IP port number. So the value of the HTTP port is needed. Change it using the SetHTTPPort() method only if the target WEB Server is listening on a port other than 80.
Prototype
PUBLIC SYSTEM.BOOLEAN SetObjectModeType(int nType, BSTR sServerName)
This method returns the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful. The operation will fail if you are already connected to the server.
nType
0 - None
2 - Client-side object with HTTP-communication support (non-persistent)
3 - Client-side object with TCP/IP-communication support (persistent)
Note
sServerName is either the DNS or IP address of HostFront Server.
Example
nRtn = SetObjectModeType(ntype)
SetReference (Int,Int)
Sets the coordinate system to a reference or absolute position.
For example, if you called SetReference(3, 3) and then called GetFieldEx(5, 5), the GetFieldEx function will GetFieldEx(5-3+1, 5-3+1) in the actual screen. By default, Reference’s Row and Col are 1 and 1.
SetServerVersion (Int)
Sets the version of the HostFront server for backwards compatibility. To work with current release of HostFront, set the version to 403. To work with a previous release, set the version to the release number of that release (353 for example).
Prototype
Public Overridable Function SetServerVersion(ByVal nVersion As Integer) As Integer
SetSSL (int)
Sets the connection type to HTTP using SSL (HTTPS).
Prototype
BOOLEAN SetSSL (BOOLEAN bSet)
This method returns one of the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
SetTargetEmulation (HFPLib_ENUM_EMULATION)
Specify the type of emulation you want to use (3270 for HFM or 5250 for HFA). You have to call this method before connecting even if you have only one emulation installed.
Prototype
BOOLEAN SetTargetEmulation (ENUM_EMULATION emulation)
Emulation
•  eEmulUnknown = -1
•  eEmul5250= 0
•  eEmul3270= 1
This method returns one of the following:
•  TRUE if the specified emulation is valid
•  FALSE if the operation is not successful
UseHFEE (Int)
Specify whether you want to use HFEE (version >= 4.0) or previous version of HostFront (< 3.6.0). You have to call this method before connecting.
Prototype
BOOLEAN UseHFEE (BOOLEAN bUse)
bUse
•  TRUE to use HFEE (default value)
•  FALSE otherwise
This method returns one of the following:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
UseSessionLoadBalancing (Int)
Used for backwards compatibility to use the integration component of version 4.x with the HostFront server 3.5.x. However, we always recommend using the integration component and server as one pair from the same HostFront release.
Parameters
A parameter value of 0 (zero) will result in working with the older server version. Any other value will result in working with the version 4.x.
Enumerator library reference
This component comprises of the following Enumerators:
Table 13: HostFront COM enumerator class
Name of the COM Enumerator Value of the COM Enumerators
XFER 3270 Host Type
eXfer3270_CICS
eXfer3270_CMS
eXfer3270_TSO
XFER 3270 Record Format
eXfer3270_RF_Default
eXfer3270_RF_Fixed
eXfer3270_RF_Undefined
eXfer3270_RF_Variable
XFER 3270 Space
eXfer3270_SU_Blocks
eXfer3270_SU_Default
eXfer3270_SU_Tracks
XFER 3270 XFER Type
eXfer3270_ANSI
eXfer3270_ASCII
eXfer3270_Binary
XFER_3270_HOST_TYPE Enumerator
Refers to the type of Host.
Values
The following values are in the XFER_3270_HOST_TYPE enumerator.
eXfer3270_CICS
Type of Host.
Prototype
public static const HFPLib.XFER_3270_HOST_TYPE eXfer3270_CICS
Member of HFPLib.XFER_3270_HOST_TYPE
eXfer3270_CMS
Type of Host.
Prototype
public static const HFPLib.XFER_3270_HOST_TYPE eXfer3270_CMS
Member of HFPLib.XFER_3270_HOST_TYPE
eXfer3270_TSO
Type of Host.
Prototype
public static const HFPLib.XFER_3270_HOST_TYPE eXfer3270_TSO
Member of HFPLib.XFER_3270_HOST_TYPE
XFER_3270_RECORD_FORMAT Enumerator
Refers to the type of format in the Host.
Values
The following values are in the XFER_3270_RECORD_FORMAT enumerator.
eXfer3270_RF_Default
Format of the record in the Host.
Prototype
public static const HFPLib.XFER_3270_RECORD_FORMAT eXfer3270_RF_Default
Member of HFPLib.XFER_3270_RECORD_FORMAT
eXfer3270_RF_Fixed
Format of the record in the Host.
Prototype
public static const HFPLib.XFER_3270_RECORD_FORMAT eXfer3270_RF_Fixed
Member of HFPLib.XFER_3270_RECORD_FORMAT
eXfer3270_RF_Undefined
Format of the record in the Host.
Prototype
public static const HFPLib.XFER_3270_RECORD_FORMAT eXfer3270_RF_Undefined
Member of HFPLib.XFER_3270_RECORD_FORMAT
eXfer3270_RF_Variable
Format of the record in the Host.
Prototype
public static const HFPLib.XFER_3270_RECORD_FORMAT eXfer3270_RF_Variable
Member of HFPLib.XFER_3270_RECORD_FORMAT
XFER_3270_SPACE Enumerator
Indicates the type of storage unit used by the Host.
Values
The following values are in the XFER_3270_SPACE enumerator.
eXfer3270_SU_Blocks
Type of storage unit used by the Host.
Prototype
public static const HFPLib.XFER_3270_SPACE eXfer3270_SU_Blocks
Member of HFPLib.XFER_3270_SPACE
eXfer3270_SU_Default
Type of storage unit used by the Host.
Prototype
public static const HFPLib.XFER_3270_SPACE eXfer3270_SU_Default
Member of HFPLib.XFER_3270_SPACE
eXfer3270_SU_Tracks
Type of storage unit used by the Host.
Prototype
public static const HFPLib.XFER_3270_SPACE eXfer3270_SU_Tracks
Member of HFPLib.XFER_3270_SPACE
XFER_3270_XFER_TYPE Enumerator
Indicates the conversion format used during the transfer of files.
Values
The following values are in the XFER_3270_XFER_TYPE enumerator.
eXfer3270_Ansi
Conversion format used during the transfer of files.
Prototype
public static const HFPLib.XFER_3270_XFER_TYPE eXfer3270_Ansi
Member of HFPLib.XFER_3270_XFER_TYPE
eXfer3270_Ascii
Conversion format used during the transfer of files.
Prototype
public static const HFPLib.XFER_3270_XFER_TYPE eXfer3270_Ascii
Member of HFPLib.XFER_3270_XFER_TYPE
eXfer3270_Binary
Conversion format used during the transfer of files.
Prototype
public static const HFPLib.XFER_3270_XFER_TYPE eXfer3270_Binary
Member of HFPLib.XFER_3270_XFER_TYPE
XMLDoc class library reference
It is important to note that the XMLDoc class cannot exist unless the HostLink object exists. The XMLDoc class is completely dependent on the HostLink object. We cannot define fields unless HostLink is currently pointing to a particular screen. Therefore, the XMLDoc cannot be created unless we first create the HostLink Object by calling the CreateXMLObj method in the HostLink Object.
Below is a summary of the methods and properties associated with the XML Doc Class.
Table 14: XMLDoc class library
Associated methods Associated property
AddAttribute (String,String,Int,Int,Int,Int)
BeginNode (String)
EndNode()
GetXMLError()
LoadXMLFile (String)
LoadXMLString (String)
SaveXMLFile (Object)
SaveXMLString()
XMLDocClass()
XMLGetField (String,Int,Int,Int,Int)
ScreenTemplate
Methods
The following methods are associated with the XMLDoc class.
AddAttribute (String,String,Int,Int,Int,Int)
The AddAttribute method adds attributes to the current node. The value of the node can be specified by a parameter or can be obtained from the screen given the coordinate position.
Example
BeginNode(“Purchase Order”)
.AddAttribute "Number1", , 19, 23, 28
.AddAttribute "Number2", “999”
EndNode

This will produce the following XML tag:
<Purchase Order Number1="111" Number2="999"/>
BeginNode (String)
The BeginNode method can hold many childnodes. A tagname can be a childnode of the node defined by the BeginNode method.
Example
BeginNode(“Purchase Order”)
XMLGetField(“Number”,2,5)
EndNode

This will produce the following XML tags:
<Purchase Order>
<Number>12345</Number>
</Purchase Order>
EndNode()
Use the EndNode method to close the parent node defined by BeginNode (See BeginNode)
GetXMLError()
The GetXMLError method returns any errors that may have occurred while executing any of the methods.
LoadXMLFile (String)
The LoadXMLFile method allows you to read an existing XML file with a certain XML schema and put the data into a host screen.
Example
XMLDoc.LoadXMLFile(“C:\Folder\Sub-folder..”)
LoadXMLString (String)
The LoadXMLString method is the same as the LoadXMLFile except that the input data is a stream of data (String) instead of a file.
SaveXMLFile (Object)
The SaveXMLFile method lets you save the XML document in any location of the hard drive. You can also save it to a location on a web server.
Example
Saving on the hard drive
XMLDoc.SaveXMLFile(“C:\Folder\Sub-folder..”)
Saving on a web server
XMLDoc.SaveXMLFile(“http://servername/virtualfolder”)
SaveXMLString()
The SaveXMLString method allows you to save the XML content to a stream of data. This is useful when you want to transfer the XML data to another computer without sending the actual XML File.
XMLDocClass()
The CreateXMLDoc class creates the XMLDoc component. From there, the client can then work this component with the methods within.
XMLGetField (String,Int,Int,Int,Int)
Once the XMLDoc has been created, the client can indicate which data to extract from the screen giving the screen coordinates of the field. An XML tag will be created with the given Tagname. The text of this XML tag will be the extracted data from the screen. The XML Tag will appear like the following:
<TagName row="2" col1="5">helloTagName row="2" col1="5">hello</TagName>
Properties
The following property is associated with the XMLDoc class.
ScreenTemplate
The ScreenTemplate Property allows you to define a location of a template file, which is in XML format. Instead of using BeginNode, EndNode, XMLGetField, or AddAttribute, we can simply define the desired data within a template. When the client application calls the SaveXMLFile or SaveXMLString, the template file will be used if this property has been defined.
Additionally, we can retrieve data from multiple screens within the template. Two HostLink commands are currently defined to permit navigation: PushKey and PutField. Their syntax within the template is as follows. Note that XML is case-sensitive.
<HostLink command="PushKey" key="32778"/> ‘Sends an ENTER command to the host
<HostLink command="PutField" data="fieldvalue" row="1" col="2" flags="0"/>
An example of a template file follows:
<?xml version="1.0"?>
<!-- The PO information is found on the first screen.-->
<!-- Notice that we send a HostLink PushKey command -->
<!-- to obtain the company info from the second screen. -->
<PO>
<Number row="19" col1="30" col2="39"/>
<AddAttribute name="Att1" value="Number Att 1"/>
<AddAttribute name="Att2" row="19" col1="23" col2="28"/>
<Date>
<AddAttribute name="Att3" row="19" col1="23" col2="28"/>
<Year row="19" col1="23" col2="28"/>
<AddAttribute name="Att4"/>
</Date>
<Items>
<Item>
<Description row="19" col1="23" col2="28"/>
</Item>
<Item>
<Description row="20" col1="23" col2="28"/>
</Item>
</Items>
<Region row="20" col1="23" col2="28"/>
<HostLink command="PushKey" key="32778"/>
<Company>
<Name row="2" col1="1" col2="3"/>
</Company>
</PO>
Sample VB code using XML methods
The sample code below illustrates how the XML methods are incorporated within a VB Application, using a basic design form in Visual Basic (See figure below).
Image
Option Explicit

Private oHFP As HFPLib.HostLink
Private oXML As HFPLib.XMLDoc
Private lngStatus As Long

Private Sub Form_Load()
Set oHFP = New HFPLib.HostLink
End Sub

Private Sub Form_Unload(Cancel As Integer)
oHFP.Disconnect
Set oHFP = Nothing
End Sub

Private Sub Connect_Click()
Screen.MousePointer = vbHourglass
lngStatus = oHFP.Connect("mcgillvm1")
If lngStatus = 0 Then
MsgBox "Unable to connect"
Else
MsgBox "Connect succeeded"
End If
Screen.MousePointer = vbNormal
End Sub

Private Sub Read_Click()
Set oXML = oHFP.CreateXMLObj("Input")

If chkString.Value = vbChecked Then
Dim strTemp As String
strTemp = "<?xml version=""1.0""?><PO><Number row=""2"" col1=""2"" 
col2=""39"">11111</Number><Date><Year row=""3"" col1=""2"" 
col2=""28"">2001</Year></Date><Items><Item><Description row=""4"" 
col1=""2"" col2=""14"">Hammer</Description></Item><Item><Description 
row=""5"" col1=""2"" col2=""49"">Wrench</Description></Item></Items>
<Region row=""6"" col1=""2"" col2=""56"">Montreal</Region></PO>"
lngStatus = oXML.LoadXMLString(strTemp)
Else
lngStatus = oXML.LoadXMLFile(".\input.xml")
End If

If lngStatus = 0 Then
MsgBox "Error"
Else
MsgBox "Succeeded"
End If

Set oXML = Nothing
End Sub

Private Sub Save_Click()
If chkTemplate.Value = vbChecked Then
Set oXML = oHFP.CreateXMLObj("PO")
oXML.ScreenTemplate = ".\template.xml"

If chkString.Value = vbChecked Then
MsgBox oXML.SaveXMLString
Else
lngStatus = oXML.SaveXMLFile(".\output_from_template.xml")
End If
Else
Set oXML = oHFP.CreateXMLObj("PO")

With oXML
.XMLGetField "Number", 19, 30, 39
.addAttribute "Att1", "Number at Att 1"
.addAttribute "Att2", , 19, 23, 28
.BeginNode "Date"
.addAttribute "Att3", , 19, 23, 28
.XMLGetField "Year", 19, 23, 28
.addAttribute "Att4"
.EndNode
.BeginNode "Items"
.BeginNode "Item"
.XMLGetField "Description", 19, 23, 28
.EndNode
.BeginNode "Item"
.XMLGetField "Description", 20, 23, 28
.EndNode
.EndNode
.XMLGetField "Region", 20, 23, 28

oHFP.PushKey 32778
.BeginNode "Company"
.XMLGetField "Name", 2, 1, 3
.EndNode
End With

If chkString.Value = vbChecked Then
MsgBox oXML.SaveXMLString
Else
lngStatus = oXML.SaveXMLFile(".\output.xml")
End If
End If

If chkString.Value = vbUnchecked Then
If lngStatus = 0 Then
MsgBox "Unable to create doc"
Else
MsgBox "Doc created successfully"
End If
End If

Set oXML = Nothing
End Sub
Here are the input and output XML files needed (or created) with the application
template.xml
<?xml version="1.0"?>
<!-- The PO information is found on the first screen. -->
<!-- Notice that we send a HostLink PushKey command -->
<!-- to obtain the company info from the second screen. -->
<PO> <Number row="19" col1="30" col2="39"/>
<AddAttribute name="Att1" value="Number Att 1"/>
<AddAttribute name="Att2" row="19" col1="23" col2="28"/>
<Date>
<AddAttribute name="Att3" row="19" col1="23" col2="28"/>
<AddAttribute name="Att4"/>
</Date>
<Items>
<Item>
<Description row="19" col1="23" col2="28"/>
</Item>
<Item>
<Description row="20" col1="23" col2="28"/>
</Item>
</Items>
<Region row="20" col1="23" col2="28"/>
<HostLink command="PushKey" key="32778"/>
<Company>
<Name row="2" col1="1" col2="3"/>
</Company>
</PO>

output_from_template.xml
<?xml version="1.0" ?>
<PO>
<Number Att1="Number Att 1" Att2="tools">11111</Number>
<Date Att3="tools">
<Year Att4="">>2001</Year>
</Date>
<Items>
<Item>
<Description>Hammer</Description>
</Item>
<Item>
<Description>Wrench</Description>
</Item>
</Items>
<Region>Montreal</Region>
<Company>
<Name>SEAGULL</Name>
</Company>
</PO>

output.xml
<?xml version="1.0" ?>
<PO>
<Number Att1="Number Att 1" Att2="tools">11111</Number>
<Date Att3="tools">
<Year Att4="">2001</Year>
</Date>
<Items>
</Item>
<Description>Hammer</Description>
</Item>
<Item>
<Description>Wrench</Description>
</Item>
</Items>
<Region>Montreal</Region>
<Company>
<Name>SEAGULL</Name>
</Company>
</PO>

input.xml
<?xml version="1.0"?>
<PO>
<Number row="2" col1="2" col2="39">11111</Number>
<Date>
<Year row="3" col1="2" col2="28">2001</Year>
</Date>
<Items>
<Item>
<Description row="4" col1="2" col2="14">Hammer</Description>
</Item>
<Item>
<Description row="5" col1="2" col2="49">Wrench</Description>
</Item>
</Items>
<Region row="6" col1="2" col2="56">Montreal</Region>
</PO>
Multilanguage support functions
The ActiveX methods are a subgroup that allow you to support the Arabic language. These ActiveX methods can be called on both the client side and the server side.
Table 15: Multilanguage methods
Methods associated with multilanguages
CheckFieldEx
GetFieldEx
IsFlippedMode
IsModeASCII
IsModeRDE
IsNumericDistinction
IsRightToLeft
PutFieldEx
SetArabicMode
SetModeASCII
Methods
The following methods are associated with multilanguages.
CheckFieldEx
The CheckFieldEx() method confirms that a specific string of data exits at a specific location on the host screen.
Prototype
PUBLIC SYSTEM.BOOLEAN CheckFieldEx(BSTR sData, int nRow, int nCol1, int nCol2, UINT nFlag)
•  The CheckFieldEx() method will compare sData with a specific string on the host screen.
•  The nRow and nCol1 identify the row and the column where the data starts.
•  The nCol2 and nFlag are optional.
By specifying nCol2 as greater than zero, the method checks the host screen string either from Col1 to Col2 or to the end of the field, whichever is shorter.
•  The nFlag can have the values HFP_ARABIC, HFP_REVERSE or both. The nFlag element is zero by default, which means that the data is not translated.
•  The HFP_ARABIC flag forces a translation of sData from Latin to Arabic.
•  The HFP_REVERSE flag reverses the returned data.
The sData is a string. If the text is not present, the CheckFieldEx() method waits up to 6 seconds before acknowledging that the screen did not appear. This method returns one of the following:
•  TRUE if the operation is successful and the script can continue
•  FALSE if the operation is not successful and the script terminates
Note
Use the SetDelay() method to define the waiting time.
Example
BRtn = CheckFieldEx("Sign", 1, 35)
The CheckFieldEx() method checks to see that the field at row 1 and column 35 contains the string Sign. BRtn = CheckFieldEx("Sign", 1, 35, 38)
The CheckFieldEx() method checks to see that the field at row 1 between column 35 and 38 contains the character string Sign. FLAG = HFP_ARABIC OR HFP_LATIN
BRtn = CheckFieldEx(“ArabicReversedString”, 1, 35, 38, HFP_ARABIC| HFP_REVERSE)
The CheckFieldEx() method performs the following:
•  gets the field data at row 1 between column 35 and 38
•  translates the string from Latin to Arabic
•  reverses the string
•  compares the result with the ArabicReversedString
GetFieldEx
The GetFieldEx() method returns information from a given location on the host screen.
Prototype
BSTR GetFieldEx(int nRow, int nCol1, int nCol2, UINT nFlag)
This method returns a string of the characters located at a specified screen position identified by nRow and nCol1. The information returns as a 32-bit character pointer (BSTR).
•  The nCol2 and nFlag are optional. By specifying nCol2 as greater than zero, the GetField() method returns the information until it reaches the second column or the end of the field, whichever is shorter.
•  The nCol2 element is zero by default, which returns the entire field string.
•  The nFlag can have the values HFP_ARABIC, HFP_REVERSE or both. The nFlag element is zero by default, which means that the data is not translated.
•  The HFP_ARABIC flag forces a translation of the returned data from Latin to Arabic.
•  The HFP_REVERSE flag reverses the returned data.
Example
SystName = GetFieldEx(2, 70)
This GetFieldEx() method returns the field starting at row 2 and column 70 and stores the result in the SystName variable.
UserName = GetFieldEx(6, 20, 26)
This GetFieldEx() method returns the string at row 6 between columns 20 and 26 and stores the result in the UserName variable.
FLAG = HFP_Arabic OR HFP_Reverse
UserName = GetFieldEx(6, 20, 26, FLAG) This GetFieldEx() method performs the following:
•  gets the string at row 6 between columns 20 and 26
•  translates the string from Latin to Arabic
•  reverses the string
•  stores the result in the UserName variable
UserName = GetFieldEx(6, 20, 26, HFP_ARABIC)
This GetFieldEx() method translates the string from Latin to Arabic.
IsFlippedMode
The IsFlippedMode method flips the host screen and creates a mirror image of it.
Prototype
PUBLIC SYSTEM.BOOLEAN IsFlippedMode
Example
bRtn = IsFlippedMode
IsModeASCII
The IsModeASCII() method defines how data is exchanged between the object and the user application. The data string mode can be set to ASCII or ANSI format.
Prototype
PUBLIC SYSTEM.BOOLEAN IsModeASCII()
This method returns the following:
•  TRUE if the data string is ANSI
•  FALSE if the data string is ASCII
Example
bRtn IsModeASCII ()
IsModeRDE
The IsModeRDE method retrieves the mode of the data entry operation for an Arabic language session.
Prototype
PUBLIC SYSTEM.BOOLEAN IsModeRDE()
This method returns one of the following:
•  TRUE when the operation is set to RDE mode
•  FALSE when the operation is set to RTE mode
Example
bRtn = PUBLIC SYSTEM.BOOLEAN IsModeRDE()
In this example, a true or false value will be returned.
Normally, text or data is entered from left to right as the cursor moves rightward. However, when text is entered in reverse mode, it appears as a mirror image of the text in normal mode.
In RTE mode, the cursor does not change place. The cursor remains flush left. Text is pushed to the right as it is entered at the cursor position in reverse mode.
Text in Normal mode Text in RTE Mode
Welcome to Rio! !oiR ot emocleW

In RDE mode, the cursor appears automatically at the end (flush right) of the current field or line. The cursor moves from right to left as the text is entered in reverse mode.
Text in Normal mode Text in RDE Mode
Welcome to Rio! !oiR ot emocleW
IsNumericDistinction
The IsNumericDistinction method retrieves the numeric distinction mode of the current host session. The host session is converted from Hindi numerals to Arabic numerals and vice versa.
Prototype
PUBLIC SYSTEM.BOOLEAN IsNumericDistinction
Example
bRtn = IsNumericDistinction
IsRightToLeft
The IsRightToLeft method reverses the direction of the data entry in a host field from left to right.
Prototype
PUBLIC SYSTEM.BOOLEAN IsRightToLeft
Example
bRtn = IsRightToLeft
PutFieldEx
The PutFieldEx() method fills fields with data on the host screen.
Prototype
PUBLIC SYSTEM.BOOLEAN PutFieldEx(VARIANT vtData, int nRow, int nCol1, UINT nFlag)
This method places a constant or the value of the variable in the field starting at the specified row and column.
•  The nFlag can have the values HFP_ARABIC, HFP_REVERSE or both. The nFlag element is zero by default, which means that the data is not translated.
•  The HFP_ARABIC flag forces a translation of the data from Arabic to Latin.
•  The HFP_REVERSE flag reverses the data.
This method returns:
•  TRUE if the operation is successful
•  FALSE if the operation is not successful
•  When you use PutFieldEx() methods on a host screen, the PushKey(ENTER) method validates your entries and moves on to the next screen.
Example
BRtn = PutFieldEx(UserName, 6, 53)
BRtn = PutFieldEx(Password, 7, 53)
BRTn = PushKey(ENTER)

The PutFieldEx() method enters the values of the user name and password variables in the user name and password fields of a host sign-on screen.
FLAG = HFP_ARABIC OR HFP_LATIN
BRtn = PutFieldEx(data, 1, 5, FLAG)

The PutFieldEx() method performs the following:
•  translates the Arabic string from Arabic to Latin
•  reverses it
•  inserts the result at row 1, column 5 of the current screen.
SetArabicMode
The SetArabicMode method defines whether or not you will use numeric distinction and whether or not you will use RDE or RTE mode.
Prototype
PUBLIC SYSTEM.BOOLEAN SetArabicMode (PUBLIC SYSTEM.BOOLEAN bNumericDistinction, PUBLIC SYSTEM.BOOLEAN bRDE)
Example
bRtn = SetArabicMode (True, False)
This example will set the numeric distinction mode of the current host session to Arabic numerals from Hindi numerals and the data entry operation will be set to RTE mode.
Note: Numeric Distinction converts Arabic numbers to Latin numbers (Hindi for the Arabic language layer, Arabic for the Latin language layer) when the language mode changes. Normally, text or data is entered from left to right as the cursor moves rightward.
However, when text is entered in reverse mode, it appears as a mirror image of the text in normal mode.
In RTE mode, the cursor does not change place. The cursor remains flush left. Text is pushed to the right as it is entered at the cursor position in reverse mode.
Text in Normal mode Text in RTE Mode
Welcome to Rio! !oiR ot emocleW

In RDE mode, the cursor appears automatically at the end (flush right) of the current field or line. The cursor moves from right to left as the text is entered in reverse mode.
Text in Normal mode Text in RDE Mode
Welcome to Rio! !oiR ot emocleW
SetModeASCII
The SetModeASCII() method defines how data is exchanged between the object and the user application. The data string mode can be set to ASCII or ANSI format.
Prototype
PUBLIC SYSTEM.BOOLEAN SetModeASCII (bNewMode)
This method returns the following:
•  TRUE if the operation was successful
•  FALSE if the operation was a failure
Example
bRtn SetModeASCII (True)
This example sets the operation mode to ASCII.