' MacroName: PlaceHold ' MacroDescription: From an item record in B/I Maint or Inquiry, ' switch to Holds Processing, place a hold, ' and switch back. ' Macro written by: Joel Hahn, Niles Public Library District Sub main 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 CS.GetTextInRegion RowText, 3, 1, 3, 78 WhichButton=1 Begin Dialog Barcodes 65,58,"Barcode Entry" TextBox 2,2,60,12,.BCode OptionGroup .HoldOptions OptionButton 16,16,28,8,"Local",.OptionButton1 OptionButton 16,24,32,8,"System",.OptionButton2 OptionButton 16,32,24,8,"Item",.OptionButton3 OKButton 2,42,28,15,.OK CancelButton 32,42,29,15,.Cancel End Dialog Dim BCodeDialog As Barcodes WhichButton=Dialog(BCodeDialog) If WhichButton=0 Then Goto done barcode$=BCodeDialog.BCode HoldType%=BCodeDialog.HoldOptions If InStr(1, RowText, "MAINTENANCE", 1)>2 Then CS.Send chr(1) + "p" 'Shift-F16 'B/I Maint Else CS.Send chr(1) + "n" 'Shift-F14 'B/I Inquiry End if ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send chr(1) + "K" 'F11 ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send barcode$ + chr(13) 'Input staff card # here ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[13;49H" 'Session.Send chr(1) + "K" 'F11 ' Wait for response from host. 'CS.Receive nTimeout, chr(27) + "[8;49H" 'Session.Send "3" '1=Local, 2=System, 3=Item If HoldType%=1 Then 'System CS.Send "2" ElseIf HoldType%=2 Then 'Item CS.Send "3" Else 'Local CS.Send "1" End if ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send chr(1) + "K" 'F11 ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send " " 'Uses spacebar for "any key" ' Wait for response from host. CS.Receive nTimeout, chr(27) + "[?25h" CS.Send chr(1) + "c" 'Shift-F3 done: End Sub