Subject Re: proper()
From Charlie <tm@tc.com>
Date Sun, 13 Apr 2025 08:50:11 -0400
Newsgroups dbase.getting-started

Thanks Mervyn!!  I can put this in with my functions.

Let me ask you this.  At the end of each sentence I use a period, question mark or explanation marl.  Then one or two spaces.  How would I code this function so it would recognize the end of the sentence and if there is more text to start the next sentence with a capital letter?

I could possibly figure this out but know it would probably be easier for you.

Mervyn Bick Wrote:

> On 2025/04/12 14:54, Akshat Kapoor wrote:
> .....
> >
> > 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.
>
> If you save the following as first_upper.prg in your working directory
>
> function first_upper(cStr)
>    cStr  = upper(substr(cStr,1,1))+substr(cStr,2)
> return cStr
>
> you can use
>
> x = 'i live in a condo.'
> ? first_upper(x)
>
>
> You should actually have a separate folder for all you own functions,
> say, C:\My_Functions with a User BDE Alias My_Functions
>
> So, if first_upper.prg isn't in your working directory you would need to use
>
> set procedure to :My_Functions:first_upper.prg  to make the function
> available to your program.
>
> Mervyn.
>
>
>
>



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