ࡱ>    Root Entryb`%k1@*AF.SRCAF.DESAF.BIN  !"#$%&'()*+,-./012356789:;<=>?@ABCDEFGHIJKLMPQRSTUVWXYZ[\]^_`abcdefgijklmnopqrstuvwxyz{|}~' 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 Search the OCLC authority fileSQ8 $/UT#personcompanysubjecttitleconfer.Authority File SearchSearch:Index to search:_Search_Index_cbpn co su ti cn sca AFcho afPRSMUTIL!SendCommand @S#V F (08@H"P <X`cbutCS_________AF_NChoiceAFileDBmain5  F FmK+Passport ~u2\[ 5i5$i 5,(0i854"@H Hi5*HP U jP 54 jP 5L jP+ jPF 5V jP!$+ HjPP&( jP&( j5iPjPChr(34) Then CS.GetTextInRegion Locale$, 4, 10, 4, 7NextRec.SRC 4tNextRec.DESN1NextRec.BINO(PrevRec.SRCh0 Locale$=RTrim(Locale$) Goto Cont End If i=11 'Do While i<62 ' CS.GetChar Char$, Attrib%, 4, i ' If (Char$=Chr(34)) Or (Char$=Chr(46)) Then ' Scol%=i-1 ' Exit Do ' End If ' i=i+1 'Loop Scol% = 62 CS.GetTextInRegion Locale$, 4, 11, 4, Scol% Locale$ = Trim(Locale$) Cont: CS.PutText "GOB", 1, 1 RunMacro "PRSMUTIL!SendCommand" i=6 Do While i<25 CS.GetChar TChar$, Attrib%, i, 1 If Attrib%<>NORMAL Then LineNum=i Exit Do End If i=i+1 Loop If LineNum=0 Then If InStr(Locale$, "-")<>0 Then CS.GetChar NextSub$, Attrib%, 8, 3 If NextSub$="E" Then LineNum=1 Goto DoIt Else CS.GetChar NextSub2$, Attrib%, 11, 3 If NextSub2$="E" Then LineNum=1 Goto DoIt Else CS.PutText "GOB", 1, 1 Goto Cont End If End If Else ALoc$=Locale$ End If SRow2%=6 SCol2%=1 CS.Find ALoc$, SRow2%, SCol2% LineNum=SRow2% End If CS.GetTextInRegion LNum$, LineNum, 3, LineNum, 5 LineNum=Val(LTrim(LNum$)) If (Left(LNum$, 1)="R") Or (Left(LNum$, 1)="E") Then LineNum=Val(LTrim(Right(LNum$, Len(LNum$)-1))) End If If LineNum = 0 Then LineNum = 1 DoIt: CS.PutText LineNum+1, 1, 1 RunMacro "PRSMUTIL!SendCommand" Done: end sub Jumps to the next record in a list when FOR can't/Q]G$ +#GOBPRSMUTIL!SendCommand -ERM/#V F .>HXhx (08@CSCharAttrib__Locale_iScolTCharLineNum___NextSubNextSub2ALocSRow2SCol2LNum_main 5  F FmK+Passport ~u2\[q 2\"l4qF2\i  G  .>>8q>2\iq5@2\u5@(2\?..Wq .2\  .H!"#. .$%H,&5@GXhxl'q  2\( 5@K)H*+c,q( 2\-(5@K.H/E0 1q5@2\2345 6078898:q02\O;;H<=q8HH2\>8i h H?8i5@Y@8i5KW4@@ 8f G8ii h HABH BHEqH 2\Fu5@(2\?I   E NORMAL$SessionApplication' MacroName: PrevRec ' MacroDescription: Jumps to the previous record in a list when BAC can't sub main Dim CS as Session Set CS=CurrentSession 'CS.GetTextInRegion RecTot$, 4, 68, 4, 73 'If RecTot$="1 of 1" Then 'End If CS.GetChar Char$, Attrib%, 4, 10 If Char$<>Chr(34) Then CS.GetTextInRegion Locale$, 4, 10, 4, 70 Locale$=RTrim(Locale$) Goto Cont End If i=11 'Do While i<62 ' CS.GetChar Char$, Attrib%, 4, i ' If (Char$=Chr(34)) Or (Char$=Chr(46)) Then ' Scol%=i-1 ' Exit Do ' End If ' i=i+1 'Loop Scol% = 62 CS.GetTextInRegion Locale$, 4, 11, 4, Scol% Locale$ = Trim(Locale$) Cont: CS.PutText "GOB", 1, 1 RunMacro "PRSMUTIL!SendCommand" i=6 Do While i<25 CS.GetChar TChar$, Attrib%, i, 1 If Attrib%<>NORMAL Then LineNum=i Exit Do End If i=i+1 Loop If LineNum=0 Then If InStr(Locale$, "-")<>0 Then CS.GetTextInRegion ThisSub$, 7, 10, 7, 14 If (ThisSub$="[100]") or (ThisSub$="[110]") or (ThisSub$="[130]") or (ThisSub$="[150]") Then Goto Cont Else CS.PutText "PUP", 1, 1 RunMacro "PRSMUTIL!SendCommand" Prow%=25 CS.Find Locale$, PRow%, PCol%,,1 Prow2%=25 ' PRow2%=PRow PCol2%=PCol CS.Find ThisSub$, PRow2%, PCol2%,, 1 ' CS.Find " ", 1, 1 If Prow2%-PRow%=1 Then Goto Cont Else CS.GetTextInRegion LNum$, PRow2%, 3, PRow2%, 5 LineNum=Val(LTrim(LNum$)) If (Left(LNum$, 1)="R") Or (Left(LNum$, 1)="E") Then LineNum=Val(LTrim(Right(LNum$, Len(LNum$)-1))) End If Goto DoIt End If End If Else ALoc$=Locale$ End If SRow2%=6 SCol2%=1 CS.Find ALoc$, SRow2%, SCol2% LineNum=SRow2% End If CS.GetTextInRegion LNum$, LineNum, 3, LineNum, 5 LineNum=Val(LTrim(LNum$)) If (Left(LNum$, 1)="R") Or (Left(LNum$, 1)="E") Then LineNum=Val(LTrim(Right(LNum$, Len(LNum$)-1))) End If DoIt: CS.PutText LineNum-1, 1, 1 RunMacro "PRSMUTIL!SendCommand" Done: end sub Jumps to the previous record in a list when BAC can'tzQG$*$V+ 8#<GOBPRSMUTIL!SendCommand -[100][110][130][150]PUPREYz#V FPrevRec.DES5PrevRec.BIN_ .>HXhx (08CSCharAttrib__Locale_iScolTCharLineNum___ThisSubProwPColProw2PCol2LNum_ALocSRow2SCol2main 5  F FmK+Passport~u2\[ q 2\ "l4 qF2\ i  G.>>8q>2\iq5@2\u5@(2\? .!.W"q .2\# $.H%&'. .()H8*5@GXhxl+q 2\, 5@K 5SW 5[W 5cW-.W/q5@k2\0u5@(2\?182q2\q;38586q 2\q;8F9:;q(2\<(i h H=(i5@{0(i5W4>0 (f G(ii h H?@ABC D8EF8G8Hq82\q;IHJKq(HH2\L(i h HM(i5@{0(i5W4N0 (f G(ii h HORqH2\Su5@(2\?V   E NORMAL$SessionApplication