Originally posted by AnonJr
Not to mention the fact that all-caps is harder to read. I'd educate them on the "text size" option.
Originally posted by EtymonI'm still not quite sure why you would want to do that, but using Proper Case or Title Case is as simple as doing something like this:
Ok, I found something that interests me for the upper/lower case delimna. The first post is a function, but the second is in a language that is not familiar to me. The second appears from reading the author's reply to be more along my needs.
1) Thread: Change Case to Title Case?
http://dbforums.com/showpost.php?s=894db062aca65befb1edb2234c0331b5&p=1362916&postcount=2
2) Thread: Converting to Upper Case
http://forums.databasejournal.com/archive/index.php/t-14300.html
Does anyone have any idea how to convert the second one over to work with an Access database?
Thank you,
Etymon
Function CaseIt(fText)
Dim fTextArray, firstCharacter, lengthSentence, capitalizedSentence
fText = lcase(fText)
fTextArray = split(fText, ". ")
For i = lbound(fTextArray) to ubound(fTextArray)
firstCharacter = ucase(left(fTextArray(i),1))
lengthSentence = len(fTextArray(i))
capitalizedSentence = firstCharacter & mid(fTextArray(i), 2, lengthSentence)
CaseIt = CaseIt & capitalizedSentence
if i < ubound(fTextArray) then CaseIt = CaseIt & ". "
Next
End Function
Function PCase(string)
Dim Tmp, Word, Tmp1, Tmp2, firstCt, a, sentence, c, i
If IsNull(string) Then
PCase = Null
Exit Function
Else
string = CStr( string )
End If
a = Split( string, vbCrLf )
c = UBound(a)
i = 0
For each sentence in a
Tmp = Trim( sentence )
Tmp = split( sentence, " " )
For Each Word In Tmp
Word = Trim( Word )
Tmp1 = UCase( Left( Word, 1 ) )
Tmp2 = LCase( Mid( Word, 2 ) )
PCase = PCase & Tmp1 & tmp2 & " "
Next
PCase = Left( PCase, Len(PCase) - 1 )
If i = c then
Else
PCase = PCase & vbCrLf
End If
i = i + 1
Next
End Function
Originally posted by AnonJrThe other reason I like using the CSS technique over the PCase function is for things like this where special characters encapsulate words that should be capitalized:
I'd forgotten about that particular bit of CSS...
Originally posted by AnonJrI work with 2 applications that are DOS and UNIX based and for some reason all the text in these applications are in all CAPS. I too have the same problem with users just being accustomed to using all CAPS and it just drives me absolutely insane. I've developed web applications that provide listings for the public and I can't tell you how many times they have updated their request to have me display the information in all CAPS. I ALWAYS refuse and tell them how ridiculous it would be to do that.<
heck of a lot better than the function I wrote.. granted it covered quite a few other cases, but it just wasn't practical. Just so you know, I was using it to strip away the caps lock that the nurses seem to so love.![]()
I may post it just for reference, but it'll have to wait until I get to work tomorrow.
Originally posted by EtymonI am not completely happy with this but wanted to get something to you before I call it the evening. I will play around with it a bit more tomorrow ... that is unless someone else can tweak it better.
Thank you dayve,
I figured if there was a way that you might know it better than I.![]()
Etymon
Function CaseIt(fText)
Dim fTextArray, firstCharacter, lengthSentence, capitalizedSentence, sentenceStart, fBreakArray, fBreaks
fText = lcase(fText)
fText = replace(fText, "<br />", " <br /> ")
fTextArray = split(fText, ". ")
For i = lbound(fTextArray) to ubound(fTextArray)
if InStr(fTextArray(i), "<br />") = 0 then
firstCharacter = ucase(left(fTextArray(i),1))
sentenceStart = 2
else
fBreakArray = ubound(split(fText, "<br />"))
fTextArray(i) = Replace(fTextArray(i), "<br />", "")
for j = 1 to fBreakArray
fBreaks = fBreaks + "<br />"
next
firstCharacter = ucase(left(ltrim(fTextArray(i)), 1))
firstCharacter = fBreaks & firstCharacter
sentenceStart = 3 + ((j-2)*2)
end if
lengthSentence = len(fTextArray(i))
capitalizedSentence = firstCharacter & mid(fTextArray(i), sentenceStart, lengthSentence)
CaseIt = CaseIt & capitalizedSentence
if i < ubound(fTextArray) then CaseIt = CaseIt & ". "
Next
End Function