>>I'm in need of something that will take misc. text in a memo field and adjust it's case to be correct for sentences. As far as I know VFP will either put it in all upper case or all lower case or capitalize the first letter of each word. ... I need the equivalent of PROPER(), but one that is sentence based.
>>
>>Anybody know of something I can use? Did I miss something in VFP that does this?
>>
>You may use this code as function
>
>cString=" use it as parameter to function. hopefully it will work."
>cNewstring=""
>lCapitalize=.T.
>FOR n=1 to len(cString)
> cChar=substr(cString,n,1)
> IF empty(cChar)
> cNewstring=cNewstring+cChar
> LOOP
> ENDIF
> IF lCapitalize=.T.
> cNewstring=cNewstring+upper(cChar)
> lCapitalize=.F.
> LOOP
> ENDIF
> IF asc(cChar)=46
> lCapitalize=.T.
> ENDIF
> cNewstring=cNewstring+cChar
>ENDFOR
>=messagebox(cNewstring)
>
Great code, but I suggest you look for !, ?, etc, besides just period.
Cheers,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing