nyrtfleury14
Technical User
Okay, so I have pieced together this macro from my basic understanding of them and from other existing macros. Basically, I want to be able to loop through a screen and have it find a search input that could be in Rows 8-17, from column 35-column 59, on page 1 through page 50. Pretty much I want to be able to enter 'John' in my search and have it find the JOHN in 'JOHN R SAMPLE'. Once it finds it I want to to say that it found it and ask if the macro wants to stop or continue.
Screen Sample:
FUNCTION ___ SELECT xxxxxxxx_________________ PW
08:04 03/19/13 PG 1
AKF PRC XXXXXXX XXXXX XXXXXXX SYSTEM COB 03/18/13
XXXXXXXXXXX XXXXXXXX SCREEN
TYPE1 _____ TYPE2 _____ POST/TRAN P MONTH __ STMT/CALNDR C
CHK# ________ ________ DATE 03/19/13 AMT _____________
S ST DATE TYPE TRANS AMOUNT DESCRIPTION
_ PD 03/18/13 XXXXX xxx.xx 00056949 JOHN R SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx 00056950 FRANK F SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx SAMPLE
_ PD 03/18/13 XXXXX xx.xx 00056820 JESSICA P PERSON
_ PD 03/18/13 XXXXX xxx.xx 00056694 JENNIFER G SMITH
_ PD 03/18/13 XXXXX xxx.xx 00057003 DOUG E DOUG
_ PD 03/18/13 XXXXX xxxx.xx 00056942 GEOFF JEFFERSON
_ PD 03/18/13 XXXX xxxx.xx SAMPLE
_ MO 03/18/13 XXXX xxxx.xx SAMPLE
<MORE>
<?>= ACTION HELP ACTION ________
What I've got:
Sub Main
Dim Sys As Object, Sess As Object, MyScreen As Object
Set Sys = CreateObject("EXTRA.System")
Set Sess = Sys.ActiveSession
Set MyScreen = Sess.Screen
Msgtext = "Enter the ML account #"
ML_num$ = Inputbox$(Msgtext, "AKF Search"," ",125%, 100%)
MyScreen.WaitHostQuiet(50)
Msgtext = "Enter all or part of the payee name"
P_name$ = Inputbox$(Msgtext, "AKF Search"," ",125%, 100%)
MyScreen.WaitHostQuiet(50)
P_name$ = UCase(P_name$)
myscreen.sendkeys("<clear>")
MyScreen.WaitHostQuiet(10)
myscreen.sendkeys("AKF <enter>")
MyScreen.WaitHostQuiet(10)
action = myscreen.putstring(ML_num$,01,26)
MyScreen.WaitHostQuiet(10)
myscreen.sendkeys("<enter>")
MyScreen.WaitHostQuiet(10)
IsMore$ = myscreen.getstring(18,29,04)
While (IsMore$ = "MORE")
test_string$ = myscreen.getstring(ROW%,35,25)
From here out I want it to look for P_name$ within all of the test_string$ from the page and tell me if it finds it. If it doesn' then I want it to hit enter and search the next page and so on.
Any help?!?!?
Screen Sample:
FUNCTION ___ SELECT xxxxxxxx_________________ PW
08:04 03/19/13 PG 1
AKF PRC XXXXXXX XXXXX XXXXXXX SYSTEM COB 03/18/13
XXXXXXXXXXX XXXXXXXX SCREEN
TYPE1 _____ TYPE2 _____ POST/TRAN P MONTH __ STMT/CALNDR C
CHK# ________ ________ DATE 03/19/13 AMT _____________
S ST DATE TYPE TRANS AMOUNT DESCRIPTION
_ PD 03/18/13 XXXXX xxx.xx 00056949 JOHN R SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx 00056950 FRANK F SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx SAMPLE
_ PD 03/18/13 XXXXX xxxx.xx SAMPLE
_ PD 03/18/13 XXXXX xx.xx 00056820 JESSICA P PERSON
_ PD 03/18/13 XXXXX xxx.xx 00056694 JENNIFER G SMITH
_ PD 03/18/13 XXXXX xxx.xx 00057003 DOUG E DOUG
_ PD 03/18/13 XXXXX xxxx.xx 00056942 GEOFF JEFFERSON
_ PD 03/18/13 XXXX xxxx.xx SAMPLE
_ MO 03/18/13 XXXX xxxx.xx SAMPLE
<MORE>
<?>= ACTION HELP ACTION ________
What I've got:
Sub Main
Dim Sys As Object, Sess As Object, MyScreen As Object
Set Sys = CreateObject("EXTRA.System")
Set Sess = Sys.ActiveSession
Set MyScreen = Sess.Screen
Msgtext = "Enter the ML account #"
ML_num$ = Inputbox$(Msgtext, "AKF Search"," ",125%, 100%)
MyScreen.WaitHostQuiet(50)
Msgtext = "Enter all or part of the payee name"
P_name$ = Inputbox$(Msgtext, "AKF Search"," ",125%, 100%)
MyScreen.WaitHostQuiet(50)
P_name$ = UCase(P_name$)
myscreen.sendkeys("<clear>")
MyScreen.WaitHostQuiet(10)
myscreen.sendkeys("AKF <enter>")
MyScreen.WaitHostQuiet(10)
action = myscreen.putstring(ML_num$,01,26)
MyScreen.WaitHostQuiet(10)
myscreen.sendkeys("<enter>")
MyScreen.WaitHostQuiet(10)
IsMore$ = myscreen.getstring(18,29,04)
While (IsMore$ = "MORE")
test_string$ = myscreen.getstring(ROW%,35,25)
From here out I want it to look for P_name$ within all of the test_string$ from the page and tell me if it finds it. If it doesn' then I want it to hit enter and search the next page and so on.
Any help?!?!?