Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Capital Letters (http://www.velocityreviews.com/forums/t789552-capital-letters.html)

Miguel Orrego 08-19-2003 01:27 PM

Capital Letters
 
I have a form which people use to register in a database. The form passes
the input data to an asp page that then updates the database.

The thing is, people often don't bother starting their firstname & surname
with a capital letter on the form. When this data is dispalyed on other
pages it would look so much better if they did.

Does anybody know a way of manipulating the input so that I can substitute
the first letter of an input string for a capital letter before I update the
database?

Some code would be great.

Cheers.



Mike 08-19-2003 01:43 PM

Re: Capital Letters
 
"Miguel Orrego" <miguel@stressedmonkey.net-nospam> wrote in message
news:3f4225da$0$18497$cc9e4d1f@news.dial.pipex.com ...
> I have a form which people use to register in a database. The form passes
> the input data to an asp page that then updates the database.
>
> The thing is, people often don't bother starting their firstname & surname
> with a capital letter on the form. When this data is dispalyed on other
> pages it would look so much better if they did.
>
> Does anybody know a way of manipulating the input so that I can substitute
> the first letter of an input string for a capital letter before I update

the
> database?
>
> Some code would be great.


fname = ucase(left(firstname, 1)) & right(firstname, len(firstname)-1)

Seems kinda sloppy, but it should work. Any quicker methods?

--
Mike



Randy Rahbar 08-19-2003 01:53 PM

Re: Capital Letters
 
> Does anybody know a way of manipulating the input so that I can substitute
> the first letter of an input string for a capital letter before I update

the
> database?


firstname = capit(firstname)

function capit(str)
str = ucase(left(str,1)) & mid(str,2)
end function



Randy Rahbar 08-19-2003 01:57 PM

Re: Capital Letters
 
> function capit(str)
> str = ucase(left(str,1)) & mid(str,2)
> end function


Oops... this should read..

function capit(str)
capit= ucase(left(str,1)) & mid(str,2)
end function



Evertjan. 08-19-2003 03:02 PM

Re: Capital Letters
 
Randy Rahbar wrote on 19 aug 2003 in
microsoft.public.inetserver.asp.general:

>> function capit(str)
>> str = ucase(left(str,1)) & mid(str,2)
>> end function

>
> Oops... this should read..
>
> function capit(str)
> capit= ucase(left(str,1)) & mid(str,2)
> end function


capit= ucase(left(str,1)) & lcase(mid(str,2))

Some people are called O'Brian:

=====================

Function ProperCase(a)
b=""
notyet=true
For i=1 to Len(a)
m=mid(a,i,1)
If notyet Then
b=b+Ucase(m)
Else
b=b+Lcase(m)
End If
If Ucase(m)=Lcase(m) Then
notyet= true
Else
notyet=false
End If
Next
ProperCase=b
End Function

=====================

For a Dutch site,
the lowering of "van", de", "der" should be considered.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Don Verhagen 08-19-2003 03:19 PM

Re: Capital Letters
 
In news:3f4225da$0$18497$cc9e4d1f@news.dial.pipex.com ,
Miguel Orrego <miguel@stressedmonkey.net-nospam> typed:
: I have a form which people use to register in a database. The form
: passes the input data to an asp page that then updates the database.
:
: The thing is, people often don't bother starting their firstname &
: surname with a capital letter on the form. When this data is
: dispalyed on other pages it would look so much better if they did.

Not to be too coy, but it would look better to *you*. Why decide? Let the
user type the name in how they want to it appear (with obvious limitations
on "special/extended" characters). Give the user the ability to change the
way their name appears and leave it at that.

As mentioned in another post a dutch name with "de" should be left in lower
case, you would suggest changing it to:

Hans de Husen to Hans De Husen, which to the user, would not "look much
better" if you did.

My 2 cents, don't sweat the small stuff.

Don Verhagen
Tandem Staffing Solutions, Inc.






: Does anybody know a way of manipulating the input so that I can
: substitute the first letter of an input string for a capital letter
: before I update the database?
:
: Some code would be great.
:
: Cheers.



Dave Anderson 08-20-2003 02:27 PM

Re: Capital Letters
 
"Evertjan." wrote:
>
> Yes, empty strings exist.
>
> No, you cannot type them in.


I am, for better or worse, stuck with a mind that accepts nothing at face
value, so I gave this some thought, and concur.

I note, however, that (a) you can un-type a non-empty string (thus making it
empty), and (b) you can type a NULL value in Enterprise Manager (CTRL+0).


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.




All times are GMT. The time now is 08:36 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.