'MacroName:formHeadings 'MacroDescription: global CS As Object '------------ function GetAllCorps dim temp$, x% x% = 1 do CS.GetField "610", x%, corps$ if corps$ > "" then if instr(corps$, "2 fast") or instr(corps$, "2 rbgenr") then ' do nothing else temp$ = temp$ & corps$ & "|" end if else exit do end if x% = x% + 1 loop GetAllCorps = temp$ end function '------------ function GetAllPeeps dim temp$, x% x% = 1 do CS.GetField "600", x%, corps$ if corps$ > "" then temp$ = temp$ & corps$ & "|" else exit do end if x% = x% + 1 loop GetAllPeeps = temp$ end function '------------ function GetAllGenres dim temp$, x% x% = 1 do CS.GetField "655", x%, genre$ if genre$ > "" then if instr(genre$, "2 fast") or instr(genre$, "2 rbgenr") then ' do nothing else temp$ = temp$ & genre$ & "|" end if else exit do end if x% = x% + 1 loop GetAllGenres = temp$ end function '------------ function GetAllSubjects dim temp$, x% x% = 1 do CS.GetField "650", x%, subject$ if subject$ > "" then if instr(subject$, "2 fast") then 'do nothing else temp$ = temp$ & subject$ & "|" end if else exit do end if x% = x% + 1 loop x% = 1 do CS.GetField "651", x%, subject$ if subject$ > "" then if instr(subject$, "2 fast") then 'do nothing else temp$ = temp$ & subject$ & "|" end if else exit do end if x% = x% + 1 loop GetAllSubjects = temp$ end function '------------ Sub Main Set CS = CreateObject("Connex.Client") AllGenres$ = GetAllGenres AllSubjects$ = GetAllSubjects AllCorps$ = GetAllCorps() AllPeeps$ = GetAllPeeps() CS.GetFixedField "type", MARCtype$ 'biographies if Marctype$ = "i" then CS.GetFixedField "LTxt", biog$ else CS.GetFixedField "biog", biog$ end if select case biog$ case "a" form$ = "Autobiographies" case "b", "d" form$ = "Biographies" end select if instr(AllGenres$, form$) or form$ = "" then 'do nothing else CS.AddField 99, "655 7" & form$ end if 'form CS.GetFixedField "form", Form$ select case form$ case "d" temp$ = "Large type books" case "f" temp$ = "Braille books" case "r" temp$ = "Facsimiles" case else temp$ = "" end select if temp$ > "" and not instr(AllGenres$, temp$) then CS.AddField 99, "655 7" & temp$ 'magazines CS.GetFixedField "SrTp", srtp$ select case srtp$ case "p" form$ = "Periodicals" case "n" form$ = "Newspapers" case else form$ = "" end select if instr(AllGenres$, form$) or form$ = "" then 'do nothing else CS.AddField 99, "655 7" & form$ end if 'LitF CS.GetFixedField "LitF", LitF$ select case LitF$ case "d" case "e" temp$ = "Essays" case "f" case "h" case "i" temp$ = "Personal correspondence" case "j" case "p" case "s" temp$ = "Speeches" case else temp$ = "" end select if temp$ > "" then CS.Addfield 99, "655 7" & temp$ 'anecdotes if instr(AllSubjects$, "v Anecdotes") then if instr(AllGenres$, "Anecdotes") then 'do nothing else CS.Addfield 99, "655 7Anecdotes" end if end if 'blogs if instr(AllPeeps$, "v Blogs") then if instr(AllGenres$, "Blogs") then 'do nothing else CS.Addfield 99, "655 7Blogs" end if end if 'conversation and phrase books if instr(AllSubjects$, "v Conversation and phrase books") then if instr(AllGenres$, "Phrase books") then 'do nothing else CS.Addfield 99, "655 7Phrase books" end if end if 'Catalogues raisonnés if instr(AllPeeps$, "v Catalogues raison") then if instr(AllGenres$, "Catalogues raison") then 'do nothing else CS.Addfield 99, "655 7Catalogues raisonnes" end if end if 'chronology if instr(AllSubjects$, "Chronology") then if instr(AllGenres$, "Chronologies") then 'do nothing else CS.Addfield 99, "655 7Chronologies" end if end if 'correspondence if instr(AllSubjects$, "correspondence") then if instr(AllGenres$, "correspondence") then 'do nothing else CS.Addfield 99, "655 7Personal correspondence" end if end if 'diaries if instr(AllSubjects$, "v Diaries") then if instr(AllGenres$, "Diaries") then 'do nothing else CS.Addfield 99, "655 7Diaries" end if end if 'dictionaries if instr(AllSubjects$, "v Dictionaries") then if instr(AllGenres$, "Dictionaries") then 'do nothing else CS.Addfield 99, "655 7Dictionaries" end if end if 'directories if instr(AllSubjects$, "v Directories") then if instr(AllGenres$, "Directories") then 'do nothing else CS.Addfield 99, "655 7Directories" end if end if 'examinations if instr(AllSubjects$, "v Examinations") then if instr(AllGenres$, "Examinations") then 'do nothing else CS.Addfield 99, "655 7Examinations" end if end if 'guidebooks if instr(AllSubjects$, "v Guidebooks") then if instr(AllGenres$, "Guidebooks") then 'do nothing else CS.Addfield 99, "655 7Guidebooks" end if end if 'handbooks if instr(AllSubjects$, "v Handbooks, manuals") then if instr(AllGenres$, "Handbooks and manuals") then 'do nothing else CS.Addfield 99, "655 7Handbooks and manuals" end if end if 'humor if instr(AllSubjects$, "v Humor") then if instr(AllGenres$, "Humor") then 'do nothing else CS.Addfield 99, "655 7Humor" end if end if 'personal narratives if instr(AllSubjects$, "v Personal narratives") then if instr(AllGenres$, "Personal narratives") then 'do nothing else CS.Addfield 99, "655 7Personal narratives" end if end if 'pictorial works if instr(AllSubjects$, "v Pictorial works") then if instr(AllGenres$, "Pictorial works") then 'do nothing else CS.Addfield 99, "655 7Illustrated works" end if end if 'problems and exercises if instr(AllSubjects$, "v Problems, exercises") then if instr(AllGenres$, "Problems and exercises") then 'do nothing else CS.Addfield 99, "655 7Problems and exercises" end if end if 'readers if instr(AllSubjects$, "v Readers") then if instr(AllGenres$, "Readers (Publications)") then 'do nothing else CS.Addfield 99, "655 7Readers (Publications)" end if end if 'study guides if instr(AllSubjects$, "v Study guides") then if instr(AllGenres$, "Study guides") then 'do nothing else CS.Addfield 99, "655 7Study guides" end if end if 'tables if instr(AllSubjects$, "v Tables") then if instr(AllGenres$, "Tables (Data)") then 'do nothing else CS.Addfield 99, "655 7Tables (Data)" end if end if 'textbooks if instr(AllSubjects$, "v Textbooks") then if instr(AllGenres$, "Textbooks") then 'do nothing else CS.Addfield 99, "655 7Textbooks" end if end if 'yearbooks if instr(AllCorps$, "Students " & chr(223) & "v Yearbooks") then if instr(AllGenres$, "yearbooks") then 'do nothing else CS.Addfield 99, "655 7School yearbooks" end if end if End Sub