' MacroName: GoForward ' MacroDescription: Go Forward (F8) a certain number of records or items ' Macro 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 = 180 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)) DoDialog: Begin Dialog UserDialog 166,45,"Go Forward" Text 4,8,120,8,"Type the number of times to go forward:" TextBox 124,6,36,12,.Num OKButton 76,24,40,14 CancelButton 120,24,40,14 End Dialog Dim Recs as UserDialog Recs.Num = EndRec - CurrRec z = Dialog(Recs) If z = 0 Then Goto Done a$=Recs.Num 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 "Only numbers, please." Goto DoDialog End If total=Val(Recs.Num) If total>EndRec-CurrRec Then total=EndRec-CurrRec curr=1 Do While curr<=total CS.Send chr(1) + "H" ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" curr=curr+1 Loop Set LockStep = Nothing MsgBox "Done!" Done: End Sub