' MacroName: MarcReturn ' MacroDescription: Return from a record called up by MarcSwitch to the original item in a call number search. ' Written by: Joel Hahn, Niles Public Library District Sub main ' After using MarcSwitch to switch from an item record in a ' call number search to the corresponding MARC record, use ' the data written out to switch back to the original point ' in the call number search. Dim CS as Session Set CS=CurrentSession Dim nTimeOut as Integer ' The default timeout for each command is 1 minute. ' Increase this value if your host requires more time ' for each command. nTimeOut = 60 filename$="C:\clsi\MarcSwch.dat" filenum%=FreeFile Open filename$ For Input as filenum% Line Input #filenum%, retrn$ Close filenum% RecNum$=GetField(retrn$, 1, ";") SearchStr$=GetField(retrn$, 2, ";") CS.Send chr(1) + "d" '[S-F4] ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send chr(27)+"[B"+chr(27)+"[A"+chr(27)+"[A" '+chr(27)+"[A" ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send SearchStr$+chr(13) ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" TotalRecs = Val(RecNum$)-1 CurrRec = 1 Do Until CurrRec>TotalRecs CS.Send chr(1)+"H" '[F8] ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CurrRec = CurrRec + 1 Loop MsgBox "Arrived!" End Sub