Hi,
I have been trying to write a script to connect to a host on my network. For some reason, the script sometimes hangs before the word "Username:" appears on the screen, and when it doesn't, it sometimes fails to enter the username correctly (i.e. there are missing letters in the beginning or middle). The rest of the time, not very frequently, it succeeds in entering the credentials only to hang anyway.
Is there something wrong with my script?
Sub Main
Dim Row As Integer ' Screen Row
Dim Column As Integer ' Screen Column
Dim UserName As String ' String to hold User ID
Dim UserPassword As String ' String to hold user password
'DlgStart
'DlgItemAsk "UserName :" , UserName ,1, 10
'DlgItemAskQuiet "Password :" , UserPassword ,2, 10
'DlgInquire
'DlgGetItemValue 1 , UserName
'DlgGetItemValue 2 , UserPassword
'DlgEnd
SysHide "Timer"
UserName = "IBUATUSERFF1"
UserPassword = "IBUATUSERFF1"
' Does 2 or 5 matter? Seems to produce the same result.
EMSetTN5250 "Ariell", 23, 2, "COLOR" ' Set host connection
'EMSetTN5250 "Ariell", 23, 5, "COLOR" ' Set host connection
EMStartSession "*", "My5250" ' Connect to host
EMWaitText 30 , "Username:" , 1 , 17 , Row , Column ' Wait for command line prompt
'EMWaitCursor 30 , 1 , 17 ' Wait for cursor
EMSendKey UserName & "<ENTER>" ' Enter UserID and Tab to password field
'EMWaitCursor 30 , 1 , 19 ' Wait for cursor
EMSendKey UserPassword & "<ENTER>" ' Enter Password and Enter Key
EMWaitText 30 , "Selection:" , 1 , 22 , Row , Column ' Wait for command line prompt
'EMWaitCursor 30 , 1 , 17 ' Wait for cursor
End Sub
#Rumba
#Script




