This is an event driven function. This function is called whenever the user presses a key that causes a data transmission to be sent to the host. This includes keys such as the ENTER or PF1 key.
Sub OnHostKey
(strKeyName)
End Sub
strKeyName | String, input |
A text string that indicates the host key sent to the host. |
This routine is called before anything is actually sent to the host. When this routine returns then the data is actually sent to the host.
For the list of valid text strings that indicate the host key sent refer to the Macro Host Key Names for 3270, 5250 and VT section described in the SendHostKeys function. 3270, 5250 or VT Keys are enclosed within <...>. The following keys do not generate an event: ALTCURSOR, CURSOR RULER, CURSOR BLINK, Edit-xxxx keys, JUMP xxxx keys, and SELECT xxxx keys.
Rocket does not recommend using event driven functions inside of a PASSPORT macro. Instead, these functions should be used in an external program or web page that uses the PASSMAC.DLL object to interface with the PASSPORT terminal emulator program. Below is an example of using this function inside of a web page using VBScript.
Example
<HTML>
<OBJECT name=passmac classid="CLSID:6440DEE3-7072-11D0-B27A-0004AC575688" height=0 width=0></OBJECT>
<SCRIPT
language="VBScript">
Function passmac_OnScreenChanged (inState, inStart, inEnd)
Dim strText, i
strText = ""
For i = 1 To 24
strText = strText + passmac.GetString (i, 1, 80) + Chr(10)
Next
document.zform.txtscreen.Value = strText
End Function
Function
passmac_OnHostKey (keyName)
document.zform.hostkey.value = keyName
End Function
Function
passmac_OnLocalKey (keyName)
document.zform.localkey.value = keyName
End Function
</SCRIPT>
<BODY>
<FORM name=zform >
<INPUT type="button" name="btnConnect" value="Connect"
onclick="passmac.ConnectPS('A')">
Local Key: <INPUT type=text value="" name=localkey size=10
readonly>
Host Key: <INPUT type=text value="" name=hostkey size=10 readonly>
<TEXTAREA name=txtscreen rows=25 cols=81 wrap=virtual readonly></TEXTAREA>
</FORM>
<!--kadov_tag{{<placeholder id="footer">}}--> </body>
</HTML>