FUNCTION Ename$ (Iname$) ' copyright 1989, Information Disciplines, Inc. ' ' Convert person name to external form. ' ------------------------------------ ' ' This function converts the name of a person from IDI's standard internal ' representation, e.g. ' Johnson,Lyndon Baines ' to the usual form suitable for mailing labels, etc., e.g. ' Lyndon Baines Johnson ' The standard internal form is recommended for simplicity and flexibility ' in databases and files. ' posn% = INSTR(Iname$, ",") ' Find end of surname IF posn% = 0 THEN ' Test for single name Ename$ = LTRIM$(Iname$) ELSE surname$ = LTRIM$(LEFT$(Iname$, posn% - 1)) ' Extract surname prename$ = RTRIM$(MID$(Iname$, posn% + 1)) ' Extract given names IF LEN(prename$) = 0 THEN Ename$ = surname$ ELSE Ename$ = prename$ + " " + surname$ ' Construct external name END IF END IF END FUNCTION