' MacroName: GoBack ' MacroDescription: Go back (F9) a certain number of records or items ' Macro written by: Joel Hahn, Niles Public Library District Sub main ' Go back (F9) a certain number of records or items Dim CS as Session Set CS=CurrentSession Dim nTimeOut as Integer ' The default timeout for each command is 3 minutes. ' Increase this value if your host requires more time ' for each command. nTimeOut = 180 CS.GetTextInRegion ScnText, 2, 65, 2, 79 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)) DoDialog: Begin Dialog UserDialog 163,45,"Go Back" Text 4,8,112,8,"Type the number of times to go back:" TextBox 120,6,36,12,.Num OKButton 72,24,40,14 CancelButton 116,24,40,14 End Dialog Dim Recs as UserDialog Recs.Num=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>CurrRec-1 Then total=CurrRec-1 curr=1 Do While curr<=total CS.Send chr(1) + "I" ' Wait for response from host. CS.Receive nTimeOut, chr(27) + "[?25h" curr=curr+1 Loop MsgBox "Done!" Done: End Sub