Hey guys. I'm not sure if anyone here can help with Attachmate macros, but I'm working on writing a macro that will find and replace specific data. I've got the find portion of the macro written, but can't remember how to write the replace funtion. Here's what I have to help me find the information I'm looking for. At the moment, it just gives me a message box of "found it" when it locates the information, but I'm wanting it to automatically replace that information with a specific string of numbers. ie 111111111 instead of 123456789.
Thanks!
Thanks!
Code:
rc% = ConnectSession(SessID)
Do While Eof (1) <> -1
Input #1, CPN$
CPN$ = Trim(CPN$)
CheckScreen:
Rc% = GetString (1,11,Test$,5)
If Test$ = "PAGE2" then
Goto COUPON:
ElseIf Test$ = "PAGE2"then
Goto COUPON:
Else
msgbox "Must Run from PAGE2"
rc% = ResetSystem()
Exit Sub
End If
Dim stringFind As String
Dim userInput As String
If Rc% = GetString(15, 068, 2) <> "01" Then
MsgBox "Please start from Page 1 "
GoTo theend
End If
While stringFind <> CPN$
stringFind = Sess0.Screen.Search(CPN$)
If stringFind = CPN$ Then
GoTo done:
Else
Rc% = SendHostKeys("@8")
Rc% = WaitForNoX
Rc% = WaitHostQuiet(100)
End If
If Rc% = GetString(24, 002, 38) = "MESSAGE: NO MORE INFORMATION TO SHOW" Then
GoTo NotFound
End If
NotFound:
Rc% = SendHostKeys("@1")
Rc% = WaitForNoX
Rc% = WaitHostQuiet(100)
Rc% = SendHostKeys("@E")
Loop
done:
MsgBox ("Found It!")
Exit Sub
Loop