' MacroName: AF ' MacroDescription: Search the OCLC authority file ' Created by: Joel Hahn, Niles Public Library District sub main cbut=1 dim CS as Session set CS = CurrentSession On Error Goto done1 'set up the values in the choice list Dim AF$ AF$="person"+Chr$(9)+"company"+Chr$(9)+"subject"+Chr$(9)+"title" AF$=AF$+Chr$(9)+"confer." 'Set up and run the dialog box; note that cursor or "active" box 'default is whatever is set up first; Tab will move through the 'set up options in the order included Begin Dialog AuthFile 200, 85 'was 100, 110 Caption "Authority File Search" Text 14, 7, 27, 12, "Search:" TextBox 43, 6, 144, 12, .Search Text 14, 23, 70, 16, "Index to search:" ListBox 20, 33, 36, 43, AF$, .Index OkButton 80, 38, 40, 20 CancelButton 135, 38, 40, 20, .cb End Dialog dim NChoice as AuthFile dialog NChoice 'Use AFile$ to construct the search key If NChoice.Index=0 Then AFile$="pn "+NChoice.Search If NChoice.Index=1 Then AFile$="co "+NChoice.Search If NChoice.Index=2 Then AFile$="su "+NChoice.Search If NChoice.Index=3 Then AFile$="ti "+NChoice.Search If NChoice.Index=4 Then AFile$="cn "+NChoice.Search AFile$="sca "+AFile$ 'Check to see whether the Authority File is the active database, 'switch to it if necessary, and send the search. CS.GetTextInRegion DB$, 1, 78, 1, 79 If DB$<>"AF" Then CS.PutText "cho af", 1, 1 RunMacro "PRSMUTIL!SendCommand" End If CS.PutText AFile$, 1, 1 RunMacro "PRSMUTIL!SendCommand" 'Error handler; check to see if Cancel Button or Windows close 'box is used and if so end macro rather than pop up an error window done1: If Err=102 Then Resume done2 done2: end sub