finitesimian
Programmer
I am trying to make a script that executes keystrokes/actions based on data visible to a progression of screens, unfortunately my script will not execute some of the actions whenever it progresses to the next screen. I'm probably missing something relatively simple- can you tell me where I'm going wrong?
Code:
Sub Main()
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'---------------------------------------------------
'obtains data from the first screen and takes action based on data
Dim variable1 As Object
Set variable1 = Sess0.Screen.area(row1,col1,row2,col2)
Select case variable1
case "something"
'sends a keystroke which makes it go to the next screen
Sess0.Screen.Sendkeys("<pf6>")
'gets data from next screen....this is where my code doesn't want to work
Dim screen2variable As Object
Set screen2variable = Sess0.Screen.area(row1,col1,row2,col2)
'takes action based on data from screen 2
Select Case screen2variable
case "something2"
Sess0.Screen.MoveTo row1,col1
Sess0,screen.SendKeys("writesomething<Enter>")
Stop
Case "alternative"
Stop"
End Select
Case "something_else"
'takes a different action
Sess0.screen.Sendkeys("<pf8>")
Stop
End Select
End Sub