'MacroName:700to710 'MacroDescription:changes selected field from 700 to 710 option explicit '-------------------- 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 bool, x%, row%, comma%, space% dim tag$, tag1$, tag2$, relator$ relator$ = chr(223) & "e performer" row% = CS.CursorRow bool = CS.GetFieldLine (row%, tag$) if left(tag$, 3) = "700" then '700 to 710 tag$ = mid(tag$, 6) tag$ = trim(replace(tag$, relator$, "")) comma% = instr(tag$, ",") if comma% > 0 then tag1$ = mid(tag$, comma% + 2) tag2$ = trim(left(tag$, comma% - 1) & " ") tag$ = "7102 " & tag1$ & " " & tag2$ & " (Musical group) " & relator$ else tag$ = "7102 " & tag$ & " (Musical group) " & relator$ end if else '710 to 700 tag$ = mid(tag$, 6) tag$ = replace(tag$, "(Musical group) ", "") tag$ = trim(replace(tag$, relator$, "")) x% = len(tag$) - 1 : space% = 0 do if mid(tag$, x%, 1) = " " then space% = x% x% = x% - 1 loop until x% = 1 or space% <> 0 tag$ = "7001 " & mid(tag$, space% + 1) & ", " & left(tag$, space% - 1) & ". " & relator$ end if CS.SetFieldLine row%, tag$ End sub