Subject Re: proper()
From Tom <tom@railsoft.com>
Date Mon, 14 Apr 2025 14:14:36 -0400
Newsgroups dbase.getting-started

Charlie Wrote:

> Thanks much!
>
> Akshat Kapoor Wrote:
>
> > Good Evening Charlie,
> >
> > > Trying to use proper() on dbase and instead of the first word only being upper case I get this:
> > >
> > > x = "I live in a condo."
> > > proper(x)
> > > I Live In A Condo.
> > >
> > > Happens using 2019 and 11.
> > >
> > > Is this the way it is supposed to work?  Is there a function like proper for entryfields?
> >
> > Copying and pasting from help file
> >
> > PROPER( ) returns <expC> with the first character in each word
> > capitalized and the remaining letters set to lowercase. PROPER( )
> > changes the first character of a word only if it is a lowercase
> > alphabetic character
> >
> > Please note the wording "each word". Hence I would say it is WAD.
> >
> > If you want output to be "I live in a condo" then in that case use
> > breakstring() (it is there in duflp) to break the phrase into sentences
> > and then convert the first to upper case followed by rejoining all.
> >
> > Regards
> > Akshat
>
You could save your entryfield to a variable then convert the first letter to an upper case.  Make sure there is no blank(s) before the first letter.  
Example:
store form.entryfield1.value to m_test
store ltrim(m_test) to m_test
store upper(substr(m_test,1,1))+substr(m_test,2,50) to m_test
form.entryfield1.value = m_test

There are easier ways to write that, but I think this explains it a little better.



Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0