' MacroName: ChangeByCallNum_Advncd ' MacroDescription: Make advanced changes to items retrieved by a call number search ' Written by: Joel Hahn, Niles Public Library District sub main Dim Session as Session Set Session = CurrentSession Dim CS as Session Set CS = CurrentSession Dim nContinue as Integer 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 = 15 '180 On Error Resume Next FirstChoice: Begin Dialog InitChoice 126, 45, "Choices" CheckBox 8, 12, 78, 10, "Fix any $0.00 prices", .Prices CheckBox 8, 24, 78, 10, "Change Date Added", .Dates OkButton 87, 8, 28, 14 CancelButton 87, 24, 28, 14 End Dialog Dim WhichOne As InitChoice Choice=Dialog(WhichOne) If Choice=0 Then Goto Done If WhichOne.Prices=0 And WhichOne.Dates=0 Then Goto Done If WhichOne.Prices=1 Then Session.Send Chr(1) + "f" End If CS.GetTextInRegion RecNums$, 2, 50, 2, 78 'RecNums$=Session.ScreenText(2,50,1,29) place=Instr(RecNums$, "Records") RecNums$=Right(RecNums$, Len(RecNums$)-place) place2=Instr(RecNums$, "of") CurrRec=Val(Mid(RecNums$, 7, place2-7)) TotalRecs=Val(Mid(RecNums$, place2+2, Len(RecNums$)-place2)) HM$=" Enter the total number of records to change, starting with " HM$=HM$+"the current record."'+Chr(10)+" Use 'A' to change all " 'HM$=HM$+"records from the current record to the end of the list." SecondChoice: Begin Dialog ChangeRecs 126,57,"How Many?" TextBox 4,40,20,12,.HowMany Text 4,4,120,32,HM$ OKButton 28,40,32,12 CancelButton 64,40,32,12 End Dialog Dim HowMany as ChangeRecs HowMany.HowMany=CStr(TotalRecs-CurrRec+1) HMy=Dialog(HowMany) If HMy=0 Then Goto FirstChoice HMany$=HowMany.HowMany 'If InStr(1, HMany$, "A", 1)=0 Then If HMany$="0" Then Goto Done Else howm=Val(HMany$) If howm=0 Then MsgBox "Data must be a number" ' or 'A'" Goto SecondChoice 'ElseIf TotalRecs