Subject Re: Change Upper Case
From Mervyn Bick <invalid@invalid.invalid>
Date Sun, 2 May 2021 09:51:57 +0200
Newsgroups dbase.getting-started

On 2021/05/01 22:57, roy price wrote:

> Thanks for this information, I have successfully used both suggestions, which go a long way towards viewing the indexed field correctly in the Form, and changing the first character of the first word of the character field to upper case.
> However my major problem was with the second word of the character field, which sometimes is upper case and sometimes lower.
> A clue to the solution might be that there is a space before the word to be changed.
> (In Botany, the convention is for the (First letter) Species to be upper case, and the Variety in lower case.)
> Regards
> Roy price
>

The following simple code will ensure that the first character remains
upper case and the subsequent characters are in lower case.

use whatever
replace all fieldname with substr(fieldname,1,1)+lower(substr(fieldname,2))
use

The code above assumes that the first character in the field is already
upper case.  If this is not the case then

replace all fieldname with
upper(substr(fieldname,1,1))+lower(substr(fieldname,2))

If any word in the field other than the first word needs to begin with
uppercase life will become a bit more complicated.  As Gaetano has
pointed out the string will have to be parsed to identify the individual
words.  We will then need a rule stating which word(s) other than the
first word must begin with upper case.

Mervyn.