' MacroName: CostAdd ' MacroDescription: For records which have a price of $0.00, check and enter the correct cost ' Written by: Joel Hahn, Niles Public Library District sub main Dim Session as Session Set Session = CurrentSession Dim CS as Session Set CS = CurrentSession DefaultPrice$="22.00" 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 = 180 On Error Resume Next Begin Dialog TypeChoice 162,108,"Choices" OptionGroup .Choice OptionButton 8,12,48,8,"Adult Fiction",.OptionButton1 OptionButton 8,24,72,8,"Adult Non-fiction",.OptionButton2 OptionButton 8,36,64,8,"Paperback (trade)",.OptionButton3 OptionButton 8,48,68,8,"Paperback (mass)",.OptionButton4 OptionButton 8,60,36,8,"Juvenile",.OptionButton5 OptionButton 8,72,50,8,"Large Type",.OptionButton6 OptionButton 84,12,60,8,"Gov't Document",.OptionButton7 OptionButton 84,24,40,8,"Pamphlet",.OptionButton8 OptionButton 84,36,36,8,"Cassette",.OptionButton9 OptionButton 84,48,20,8,"CD",.OptionButton10 OptionButton 84,60,44,8,"Video/DVD",.OptionButton11 OptionButton 84,72,36,8,"CD-ROM",.OptionButton12 OKButton 44,88,28,14 'CancelButton 76,88,28,14 End Dialog Dim WhichType As TypeChoice WhichType.Choice=1 TypeChoice=Dialog(WhichType) 'If Choice=0 Then Goto Done Select Case WhichType.Choice Case 0 DefaultPrice$="22.00" Case 1 DefaultPrice$="45.00" Case 2 DefaultPrice$="20.00" Case 3 DefaultPrice$="6.00" Case 4 DefaultPrice$="18.00" Case 5 DefaultPrice$="24.00" Case 6 DefaultPrice$="15.00" Case 7 DefaultPrice$="3.00" Case 8 DefaultPrice$="10.00" Case 9 DefaultPrice$="17.00" Case 10 DefaultPrice$="38.00" Case 11 DefaultPrice$="20.00" End Select CS.GetTextInRegion CheckExistingPrice$, 12, 58, 12, 64 CheckExistingPrice$=Trim(CheckExistingPrice$) If CheckExistingPrice$="$0.00" or CheckExistingPrice$="$1.00" Then Session.Send chr(13) CS.Receive nTimeout, chr(27) + "[?25h" Session.Send chr(1) + "G" Cs.Receive nTimeout, "Last Activity" 'chr(27) + "[?25h" 'Sleep(500) CS.GetTextInRegion CheckPrice$, 19, 8, 19, 14 CheckPrice$=Trim(CheckPrice$) 'CheckPrice$=Trim(Session.ScreenText(19, 8, 1, 7)) If CheckPrice$="25.00" then CheckPrice=DefaultPrice$ Session.Send chr(1) + "C" CS.Receive nTimeout, chr(27) + "[?25h" '"Patron cat" 'Sleep(250) Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" Session.Send chr(27) + "[B" CS.Receive nTimeout, chr(27) + "[?25h" Session.Send CheckPrice$ + chr(1) + "J" CS.Receive nTimeout, "continue." 'chr(27) + "[?25h" 'Sleep(250) Session.Send " " CS.Receive nTimeout, chr(27) + "[?25h" 'Sleep(250) End If Done: end sub