This topic is locked

How to save all data in the database in proper case

7/9/2014 5:56:32 PM
ASPRunnerPro Tips and tricks
admin

Proper case means first letter in each word is capitalized i.e. "Mr. Jack Black"

Here is how you can do this in ASPRunnerPro.
[size="5"]1.[/size] Add the following code to AfterAppInit event:

Function pCase(strIn)

strOut = ""

nextLetterUp = True

For x = 1 To Len(strIn)

c = Mid(strIn, x, 1)

If isNumeric(c) Then

strOut = strOut & c

nextLetterUp = true

ElseIf c = " " or c = "'" or c = "-" then

strOut = strOut & c

nextLetterUp = True

Else

If nextLetterUp Then

tc = Ucase(c)

Else

tc = LCase(c)

End If

strOut = strOut & tc

nextLetterUp = False

End If

Next

pCase = strOut

End Function


[size="5"]2.[/size] Add the following code to BeforeAdd and BeforeEdit events

values("FullName")=pCase(values("FullName"))


Replace "FullName" with the actual field name.