southpaw81
Programmer
The code below is used to grab information off customer accounts in our attachmate sessions. I am trying to figure out the correct code to put in the marked section below, that will tell the macro, if you dont see (V1, L1, etc) then hit enter to go to the next page, and repeat your search, do this x amount of times, if nothing matches then end. I marked the code section with *****'s
I also dont understand the histep command, can someone explain that for me, a friend wrote that part in for me trying to help, and I dont understand how it functions.
' Global Subroutine Declarations
Declare Sub GetSystem
Declare Sub AddToMacroLog
' Global variable declarations
Global g_HostSettleTime%
Global Session As Object
Global System As Object
Global Screen As Object
Global Sess0 As Object
Global MacroName As String
Sub Main()
Dim ListsList(100) as String
GetSystem
' AddToMacroLog
Begin Dialog newdlg 175, 53
TextBox 15, 25, 90, 15, .TextBox1
OkButton 115, 10, 50, 14
CancelButton 115, 25, 50, 14
Text 15, 10, 85, 10, "Enter H1 or L1 account ID"
End Dialog
Dim dMain as newdlg
iDone = FALSE
While iDone = FALSE
nRet = Dialog(dMain)
Select Case nRet
Case -1
iDone = TRUE
AcctID = dMain.TextBox1
Filenum% = Freefile
Filename$ = "c:\" + acctID + "_VACFList.txt"
Open Filename$ for Output as Filenum%
Print # Filenum%, "Account ID ;Account Name ;List ID ;Code ;Status"
Close Filenum%
Sess0.Screen.Row = 21
Sess0.Screen.Col = 8
Sess0.Screen.Sendkeys(AcctID)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'changing from (6, 56, 6, 57)
acctType = Sess0.Screen.Area(6, 56, 6, 57)
If ((acctType = "VN") or (acctType = "TC") or (acctType = "VC") or (acctType = "L9") or (acctType = "V1")) then
acctType = "L1"
End If
Select Case acctType
Case "H1"
Sess0.Screen.Row = 22
Sess0.Screen.Col = 18
Sess0.Screen.Sendkeys("HIER<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'here its messing up
h1Count = 0
hiEnd = FALSE
While hiEnd = FALSE
For hiStep = 8 to 19
acType = Sess0.Screen.Area(hiStep, 18, hiStep, 19)
If ((acType = "VN") or (acType = "TC") or (acType = "VC") or (acType = "L9") or (acType = "V1")) then
acType = "L1"
End IF
************************
***********Here is where I need an else if after it searches
*********************
Select Case acType
Case "H1"
h1Count = h1Count + 1
If h1Count > 1 then
hiEnd = TRUE
hiStep = 19
End If
Case " "
hiEnd = TRUE
hiStep = 19
Case "L1"
Sess0.Screen.Row = hiStep
Sess0.Screen.Col = 4
Sess0.Screen.Sendkeys("M<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
I also dont understand the histep command, can someone explain that for me, a friend wrote that part in for me trying to help, and I dont understand how it functions.
' Global Subroutine Declarations
Declare Sub GetSystem
Declare Sub AddToMacroLog
' Global variable declarations
Global g_HostSettleTime%
Global Session As Object
Global System As Object
Global Screen As Object
Global Sess0 As Object
Global MacroName As String
Sub Main()
Dim ListsList(100) as String
GetSystem
' AddToMacroLog
Begin Dialog newdlg 175, 53
TextBox 15, 25, 90, 15, .TextBox1
OkButton 115, 10, 50, 14
CancelButton 115, 25, 50, 14
Text 15, 10, 85, 10, "Enter H1 or L1 account ID"
End Dialog
Dim dMain as newdlg
iDone = FALSE
While iDone = FALSE
nRet = Dialog(dMain)
Select Case nRet
Case -1
iDone = TRUE
AcctID = dMain.TextBox1
Filenum% = Freefile
Filename$ = "c:\" + acctID + "_VACFList.txt"
Open Filename$ for Output as Filenum%
Print # Filenum%, "Account ID ;Account Name ;List ID ;Code ;Status"
Close Filenum%
Sess0.Screen.Row = 21
Sess0.Screen.Col = 8
Sess0.Screen.Sendkeys(AcctID)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'changing from (6, 56, 6, 57)
acctType = Sess0.Screen.Area(6, 56, 6, 57)
If ((acctType = "VN") or (acctType = "TC") or (acctType = "VC") or (acctType = "L9") or (acctType = "V1")) then
acctType = "L1"
End If
Select Case acctType
Case "H1"
Sess0.Screen.Row = 22
Sess0.Screen.Col = 18
Sess0.Screen.Sendkeys("HIER<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
'here its messing up
h1Count = 0
hiEnd = FALSE
While hiEnd = FALSE
For hiStep = 8 to 19
acType = Sess0.Screen.Area(hiStep, 18, hiStep, 19)
If ((acType = "VN") or (acType = "TC") or (acType = "VC") or (acType = "L9") or (acType = "V1")) then
acType = "L1"
End IF
************************
***********Here is where I need an else if after it searches
*********************
Select Case acType
Case "H1"
h1Count = h1Count + 1
If h1Count > 1 then
hiEnd = TRUE
hiStep = 19
End If
Case " "
hiEnd = TRUE
hiStep = 19
Case "L1"
Sess0.Screen.Row = hiStep
Sess0.Screen.Col = 4
Sess0.Screen.Sendkeys("M<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)