I'm trying to edit a condition in to an existing Attachmate macro I've created. I need the macro to check a certain location on the screen for the character that is there. If the character is an "L", the macro needs to kick back the dialog box for Location = L. Otherwise, it needs to carry on as normal.
I'm pretty inexperienced with VB, and haven't been able to find a way to 1) Pull the character at that location.(GetString?) 2) Create a check to see if it is an L, and perform the IF/Then statement.
I'm pretty inexperienced with VB, and haven't been able to find a way to 1) Pull the character at that location.(GetString?) 2) Create a check to see if it is an L, and perform the IF/Then statement.
Code:
If [b]Location = L[/b]
Then
Begin Dialog userdialog1 80, 41, "800L ALERT"
Text 15, 5, 55, 10, "LOCATION = L!"
CancelButton 15, 20, 50, 14
End Dialog
dim mydialog1 as userdialog1
dialog mydialog1
Else
Begin Dialog userdialog2 115, 44, "800L ALERT"
Text 40, 5, 35, 10, "Set alert?"
OkButton 5, 20, 50, 14
CancelButton 60, 20, 50, 14
End Dialog
dim mydialog2 as userdialog2
dialog mydialog2
Sess0.Screen.PutString "narr", 3,12
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Date1 = Sess0.Screen.GetString (08,11,02)
Date2 = Sess0.Screen.GetString (08,14,02)
Date3 = Sess0.Screen.GetString (08,17,04)
HWFS = Sess0.Screen.GetString (24,08,07)
Sess0.Screen.MoveTo 7,39
Sess0.Screen.Sendkeys("<Pf6>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.PutString Date1,18,24
Sess0.Screen.PutString Date2,18,27
Sess0.Screen.PutString Date3,18,30
Sess0.Screen.PutString "CR",18,41
Sess0.Screen.PutString Date1,18,50
Sess0.Screen.PutString Date2,18,53
Sess0.Screen.PutString Date3,18,56
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime2)
Sess0.Screen.MoveTo 20,17
Sess0.Screen.Sendkeys("800L: see narr ")
Sess0.Screen.PutString Date1,20,32
Sess0.Screen.PutString "/",20,34
Sess0.Screen.PutString Date2,20,35
Sess0.Screen.PutString "/",20,37
Sess0.Screen.PutString Date3,20,38
Sess0.Screen.PutString " ",20,42
Sess0.Screen.PutString HWFS,20,43
Sess0.Screen.Sendkeys("<Enter>")
System.TimeoutValue = OldSystemTimeout
End If
End Sub