' MacroName: FindNote1Note2 ' MacroDescription: Go Forward until desired text is found in either Note 1 or Note 2 ' Written by: Joel Hahn, Niles Public Library District Sub main ' Go forward (F8) a certain number of records or items Dim CS as session Set CS = CurrentSession Dim nTimeOut as Integer nTimeOut = 60 CS.GetTextInRegion CallerCheck$, 3, 1, 3, 79 If InStr(1, CallerCheck$, "BIB/ITEM MAINTENANCE - Call Number Search")=0 Then MsgBox "You are not viewing a call number search" Goto Done End If CS.GetTextInRegion ScnText, 2, 65, 2, 80 place=InStr(ScnText, " of ") j=1 Do while j<=place If Mid(ScnText, j, 1) Like "[0-9]" Then place2=j Exit Do End If j=j+1 Loop CurrRec=Val(Mid(ScnText, place2, place-place2)) 'EndRec=Val(Right(ScnText, Len(ScnText)-place-3)) EndRec=Val(Mid(ScnText, place+3, Len(ScnText)-place-2)) CS.GetTextInRegion CurrScat$, 11, 58, 11, 63 CurrScat$=Trim(CurrScat$) DoDialog: Begin Dialog UserDialog 166,45,"Find Text" Text 4,8,70,8,"Type the text to find:" TextBox 76,6,84,12,.Text OKButton 76,24,40,14 CancelButton 120,24,40,14 End Dialog Dim Recs as UserDialog 'Recs.Num = CurrScat$ z = Dialog(Recs) If z = 0 Then Goto Done a$=Recs.Text 'i=1 : alph=0 'Do ' If Mid(a$, i, 1) Like "[!0-9]" Then ' alph=1 ' Exit Do ' End If ' i=i+1 'Loop While i<=Len(a$) 'If (alph=1 or a$="") Then ' MsgBox "Numbers only, please." ' Goto DoDialog 'End If ' total=Val(Recs.Num) ' If total>EndRec-CurrRec Then total=EndRec-CurrRec total=EndRec-CurrRec CS.GetTextInRegion CheckYA$, 18, 15, 19, 78 CheckYA$=Trim(CheckYA$) curr=1 Do While curr<=total CS.GetTextInRegion CheckYA$, 18, 15, 19, 78 CheckYA$=Trim(CheckYA$) 'MsgBox CheckScat$ If InStr(1, CheckYA$, Recs.Text, 1)>0 Then MsgBox "Found " & Chr(34) & Recs.Text & Chr(34) Exit Do End If CS.Send chr(1) + "H" ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" curr=curr+1 Loop If curr>total Then MsgBox "End of list" 'Goto Done End If 'Set LockStep = Nothing Done: End Sub