Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 7th, 2004, 05:09 AM
mseymen mseymen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 mseymen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Change the Case of Text to Proper

Hi!
I have used the below code to change the case of text to Proper Case. I received the following error. Please help!

Error:



Microsoft VBScript compilation error '800a0400'

Expected statement

/AddMaillist2.asp, line 10 Public Function ToTitleCase(inString) As String--------------------------------------^Code I used:
<%Public Function ToTitleCase(inString) As String
On Error GoTo Err_ToTitleCase
Dim i As Integer
Dim thisChar As String
Dim tempString As String
Dim stringLen As Integer
Dim newWord As Boolean
If (IsNull(inString)) Then
ToTitleCase = ""
GoTo Exit_ToTitleCase
End If
stringLen = Len(inString)
inString = LCase(inString)

If (stringLen > 0) Then
tempString = ""
newWord = True

For i = 1 To stringLen
thisChar = Mid(inString, i, 1)
If (IsAlpha(thisChar) = True) Then
If (newWord = True) Then
tempString = tempString & UCase(thisChar)
newWord = False
Else
tempString = tempString & thisChar
End If 'newWord = True
Else 'character is not alpha
tempString = tempString & thisChar
newWord = True
End If
Next i 'Loop through string
ToTitleCase = tempString
End If 'stringLen = 0

Exit_ToTitleCase:
Exit Function

Err_ToTitleCase:
MsgBox Err.Number & " : " & Err.Description
Resume Exit_ToTitleCase
End Function
%>

Reply With Quote
  #2  
Old October 7th, 2004, 08:35 AM
Memnoch's Avatar
Memnoch Memnoch is online now
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 53 sec
Reputation Power: 469
See This Thread.

The third function down is a ProperCase function created specifically for ASP.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Change the Case of Text to Proper


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT