>>
lcText = "THIS IS A SAMPLE. SENTENCE STRUCTURE."
>>? lcText
>>llCapital = .t.
>>FOR lnI = 1 to LEN(lcText)
>> lcChar = SUBSTR(lcText, lnI, 1)
>> DO CASE
>> CASE lcChar = SPACE(1)
>> * Do nothing
>> OTHERWISE
>> lcText = STUFF(lcText, lnI, 1, IIF(llCapital, UPPER(lcChar), LOWER(lcChar)))
>> llCapital = (lcChar $ ".?!")
>> ENDCASE
>>NEXT
>> lcText = STRTRAN(lcText, " i ", " I ")
>> lcText = STRTRAN(lcText, "monday", "Monday")
>> lcText = STRTRAN(lcText, "tuesday", "Tuesday")
>>* et cetera
>>? lcText
>
>In the end, you'll have about 50 cases in there, to satisfy the one rule of capitalization in english
capitalism language ("there are no rules, we have lists"). First, you need to capitalize the solo i, then the days of the week, then sometimes months (but you May run into trouble on that March) and an occasional moon, plus the need to distinguish between Mercury in orbit and mercury in a thermometer. Then the oddities like dutch last names with the article or prefix remaining lowercase, like deVries, or things like O'Keefe but not O'Clock. Then there are mentions of vi editor (always lower case) and the roman VI numeral (always upper). And there'll be more.
>
>Congratulations, you're well on your way of writing the first AI in VFP :).
I added a few post-processing STRTRAN() to handle the known odd cases.
My thoughts were the OP was not desiring a perfect, complete, wholly-encompassing-for-the-English-Language solution, but rather one which simply put things closer to being in proper mixed case, rather than all upper case.
Perhaps I was wrong in that assumption.
Best regards,
Rick C. Hodgin