FUNCTION proper RETURNS CHAR (INPUT instring AS CHAR).
DEF VAR X AS INTEGER NO-UNDO.
DEF VAR newstring AS CHAR NO-UNDO.
DO X=1 TO LENGTH(instring):
IF X=1 THEN
newstring=CAPS(substring(instring,X,1)).
IF X<>1 AND substring(instring,X - 1,1)<>" " THEN
newstring=newstring + LC(substring(instring,X,1)).
IF X<>1 AND substring(instring,X - 1,1)=" " THEN
newstring=newstring + CAPS(substring(instring,X,1)).
END.
RETURN newstring.
END FUNCTION.