' MacroName: BatchXpo ' MacroDescription: Given a series of save file numbers, export ' each in turn ' Macro written by: Joel Hahn, Niles Public Library District sub main ' Set up session abbreviation & variable strings dim CS as session set CS = CurrentSession Dim Check$, SaveNum$, TestNum$, TestNum2$ On Error Goto ErrHandler ' Set up input window, get input Begin Dialog Saves 320, 52 Caption "OCLC save file records to export" Text 1, 1, 140, 11, "Drop '/', separate numbers with '+'" Text 14, 13, 50, 11, "Save #'s:" TextBox 50, 13, 212, 11, .Nums OkButton 5, 28, 40, 20 CancelButton 55, 28, 40, 20 End Dialog dim NChoice as Saves NC=dialog(NChoice) If NC=0 then goto done ' Determine how many records there are c=1 Check$="+" TestNum$=NChoice.Nums For i=1 to Len(TestNum$) TestNum2$=Mid(TestNum$,i,1) If Asc(TestNum2$)=Asc(Check$) Then c=c+1 Next i 'Main loop cc=1 Do If GetField(NChoice.Nums,cc,"+")="" then goto Looper SaveNum$="/"+GetField(NChoice.Nums,cc,"+") 'CS.PutText SaveNum$, 1, 1 'RunMacro "PRSMUTIL!SendCommand" 'RunMacro "PRSMUTIL!Send" CS.Send SaveNum$+"\e" CS.Receive 30, "= Vmod SID: " '"SAVE" Goto Choice Ret: 'Choice "Ok" return point #1 CS.PutText "xpo", 1, 1 Runmacro "PRSMUTIL!SendCommand" CS.Receive 30, "USMARC" CS.PutText "s", 1, 1 Runmacro "PRSMUTIL!SendCommand" Looper: 'Choice "Skip" return point. cc=cc+1 Loop Until cc>=c+1 Goto done 'Go to the end of the macro 'Choose whether to continue with procedure on current record, 'skip current record and go on to the next, or abort altogether Choice: Begin Dialog Glitch 320, 100, 44, 65 Caption "Stopper" ButtonGroup .bg PushButton 2, 2, 40, 20, "Ok" PushButton 2, 22, 40, 20, "Skip" PushButton 2, 42, 40, 20, "Quit" End Dialog Dim Stopper as Glitch Dialog Stopper SChoices=Stopper.bg Select Case SChoices Case 2 'Quit Goto done 'End macro Case 1 'Skip Goto Looper Case 0 'Ok Goto Ret End Select ErrHandler: MsgBox "Error " & Err & "(" & Erl & "): " & Error Resume done done: end sub