'MacroName:382 'MacroDescription: '-------------------- function replace(strString as string, strOld as string, strNew as string) as string dim pos as integer pos = instr(strString, strOld) do while pos > 0 strString = left(strString, pos - 1) & strNew & mid(strString, pos + len(strOld)) pos = instr(strString, strOld) loop replace = strString end function '-------------------- Sub Main Dim CS As Object Set CS = CreateObject("Connex.Client") dim fortyEights$(10) dim perfs$(100, 1) all048$ = "ba,Horn|bb,Trumpet|bc,Cornet|bd,Trombone|be,Tuba|bf,Baritone|ca,Mixed chorus|cb,Women's chorus|cc,Men's chorus|cd,Children's chorus|ea,Synthesizer|eb,Tape|ec,Computer|ed,Ondes Martenot|ka,Piano|kb,organ|kc,Harpsichord|kd,Clavichord|ke,Continuo|kf,Celeste|oa,Orchestra|ob,Chamber orchestra|oc,String orchestra|od,Band|oe,Dance orchestra|of,Brass band|pa,Timpani|pb,Xylophone|pc,Marimba|pd,Drum|pn,Percussion, unspecified|sa,Violin|sb,Viola|sc,Violoncello|sd,Double bass|se,Viol|sf,Viola d'amore|sg,Viola da gamba|va,Soprano|vb,Mezzo soprano|vc,Alto|vd,Tenor|ve,Baritone|vf,Bass|vg,Counter tenor|vh,High voice|vi,Medium voice|vj,Low voice|wa,Flute|wb,Oboe|wc,Clarinet|wd,Bassoon|we,Piccolo|wf,English horn|wg,Bass clarinet|wh,Recorder|wi,Saxophone|" 'split all048$ do posComma% = instr(all048$, ",") if posComma% > 0 then perfs$(x%, 0) = left(all048$, 2) all048$ = mid(all048$, 4) posPipe% = instr(all048$, "|") perfs$(x%, 1) = left(all048$, posPipe% - 1) all048$ = mid(all048$, posPipe% + 1) else exit do end if x% = x% + 1 loop x% = 0 do x% = x% + 1 CS.GetField "048", x%, temp$ if temp$ = "" then exit do temp$ = mid(temp$, 6) if left(temp$, 1) <> chr(223) then temp$ = chr(223) & "a" & temp$ tag048$ = tag048$ & temp$ loop tag048$ = replace(tag048$, " ", "") tag048$ = replace(tag048$, chr(223) & "a", "|") tag048$ = replace(tag048$, chr(223) & "b", "|") if left(tag048$, 1) = "|" then tag048$ = mid(tag048$, 2) if right(tag048$, 1) <> "|" then tag048$ = tag048$ & "|" 'split tag048$ x% = 0 do posPipe% = instr(tag048$, "|") if posPipe% > 0 then fortyEights(x%) = left(tag048$, posPipe% - 1) tag048$ = mid(tag048$, posPipe% + 1) x% = x% + 1 else exit do end if loop 'compare arrays for y% = 0 to x% - 1 temp$ = fortyEights$(y%) if len(temp$) > 2 then subN$ = right(temp$, 2) if left(subN$, 1) = "0" then subN$ = right(subN$, 1) temp$ = left(temp$, 2) end if z% = 0 do if perfs$(z%, 0) > "" then if temp$ = perfs$(z%, 0) then out$ = out$ & chr(223) & "a " & lcase(perfs$(z%, 1)) if subN$ > "" then out$ = out$ & " " & chr(223) & "n " & subN$ end if else exit do end if z% = z% + 1 loop next if out$ > "" then CS.AddField 1, "38201" & out$ end if End Sub