'MacroName:formHeadings 'MacroDescription: global CS As Object global AllSubjects$ global AllGenres$ global addedGenre '------------ function GetAllGenres as string 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(tag$) as string dim temp$, x% x% = 1 do CS.GetField tag$, 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 addGenre(subj$, genre$) subj$ = "v " & subj$ if instr(AllSubjects$, subj$) then if instr(AllGenres$, genre$) = 0 then CS.Addfield 99, "655 7" & genre$ addedGenre = TRUE end if end if end sub '------------ Sub Main Set CS = CreateObject("Connex.Client") AllGenres$ = GetAllGenres() AllSubjects$ = GetAllSubjects("600") AllSubjects$ = AllSubjects & GetAllSubjects("610") AllSubjects$ = AllSubjects & GetAllSubjects("611") AllSubjects$ = AllSubjects & GetAllSubjects("630") AllSubjects$ = AllSubjects & GetAllSubjects("650") AllSubjects$ = AllSubjects & GetAllSubjects("651") 'biography/literary text CS.GetFixedField "type", MARCtype$ if MarcType$ = "i" then CS.GetFixedField "LTxt", biog$ select case biog$ case "a" form$ = "Autobiographies" case "b" form$ = "Biographies" case "c" case "d" case "e" form$ = "Essays" case "f" case "g" case "h" case "i" form$ = "Instructional and educational works" case "j" case "k" case "l" case "m" case "n" case "o" case "p" case "r" case "s" case "t" form$ = "Interviews (Sound recordings)" end select else CS.GetFixedField "biog", biog$ select case biog$ case "a" form$ = "Autobiographies" case "b", "c", "d" form$ = "Biographies" end select end if 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. " & chr(223) & "2 local" case "f" temp$ = "Braille books" case "r" temp$ = "Facsimiles" case else temp$ = "" end select if temp$ > "" and instr(AllGenres$, temp$) = 0 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 if instr(AllGenres$, temp$) = 0 then CS.Addfield 99, "655 7" & temp$ end if call addGenre("Adaptations", "Adaptations") call addGenre("Almanacs", "Almanacs") call addGenre("Anecdotes", "Anecdotes") 'Annals and chronicles if instr(AllSubjects$, "History " & chr(223) & "v Chronology") then if instr(AllGenres$, "Annals and chronicles") = 0 then CS.Addfield 99, "655 7Annals and chronicles" end if call addGenre("Bibliography", "Bibliographies") call addGenre("Blogs", "Blogs") call addGenre("Catalogues raison", "Catalogues raisonnes") call addGenre("Chronology", "Chronologies") call addGenre("Concordances", "Concordances") call addGenre("Conversation and phrase books", "Phrase books") call addGenre("Correspondence", "Personal correspondence") call addGenre("Databases", "Databases") call addGenre("Diaries", "Diaries") call addGenre("Dictionaries", "Dictionaries") call addGenre("Directories", "Directories") call addGenre("Encyclopedias", "Encyclopedias") call addGenre("Exhibitions", "Exhibition catalogs") call addGenre("Examinations", "Examinations") call addGenre("Gazetteers", "Gazetteers") call addGenre("Guidebooks", "Guidebooks") call addGenre("Handbooks, manuals", "Handbooks and manuals") call addGenre("Humor", "Humor") call addGenre("Indexes", "Indexes") call addGenre("Interviews", "Interviews") call addGenre("Outlines, syllabi, etc.", "Outlines and syllabi") call addGenre("Personal narratives", "Personal narratives") call addGenre("Pictorial works", "Illustrated works") call addGenre("Problems, exercises", "Problems and exercises") call addGenre("Programmed instruction", "Programmed instructional materials") call addGenre("Quotations", "Quotations") call addGenre("Readers", "Readers (Publications)") call addGenre("Recipes", "Cookbooks") call addGenre("Reverse indexes", "Reverse dictionaries") call addGenre("Slave narratives", "Slave narratives") call addGenre("Statistics", "Statistics") call addGenre("Study guides", "Study guides") call addGenre("Stories, plots, etc.", "Plot summaries") call addGenre("Style manuals", "Style manuals") call addGenre("Tables", "Tables (Data)") call addGenre("Telephone directories", "Telephone directories") call addGenre("Textbooks", "Textbooks") call addGenre("Toy and movable books", "Toy and movable books") 'yearbooks if instr(AllSubjects$, "Students " & chr(223) & "v Yearbooks") then if instr(AllGenres$, "yearbooks") = 0 then CS.Addfield 99, "655 7School yearbooks" end if call addGenre("Yellow pages", "Yellow pages") 'if addedGenre then CS.ControlHeadingsAll 'CS.CursorRow = 999 End Sub