Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Converting the forums to ALL CAPS?
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Etymon
Advanced Member

United States
2385 Posts

Posted - 21 May 2006 :  19:09:48  Show Profile  Visit Etymon's Homepage  Reply with Quote
Thank you dayve,

I figured if there was a way that you might know it better than I.

Etymon
<
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 May 2006 :  19:43:41  Show Profile  Visit dayve's Homepage  Reply with Quote
quote:
Originally posted by Etymon

Thank you dayve,

I figured if there was a way that you might know it better than I.

Etymon



I 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.


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


Example:
http://www.burningsoulsforum.com/caseit.asp

PS. Whatever you do, just don't share the code with http://www.thedailywtf.com

BAH!!! I must be tired. I didn't account for question marks and exclamation points. I've also made way too many assumptions on what characters precede a sentence. I didn't account for things like italicize, bolding, etc. More edits <


Edited by - dayve on 21 May 2006 20:22:04
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 22 May 2006 :  04:18:46  Show Profile  Visit Etymon's Homepage  Reply with Quote
Oh, dayve!

Don't wipe yourself out on this, ok?!

Thank you for the code though. It looks complicated ... no doubt!

Cheers,

Etymon<
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 May 2006 :  16:59:12  Show Profile  Visit dayve's Homepage  Reply with Quote
Well, there are just so many conditions to code for, but I did find something I thought was cute. It capitalizes as you type. While it is not perfect, it does give me some ideas.

http://www.hafresno.org/test/autocap.html<

Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 22 May 2006 :  17:30:46  Show Profile  Visit Etymon's Homepage  Reply with Quote
That's ok, dayve.

Thank you for all of your hard work anyway!

The CaseIt function is still something that I can use, and I'm sure she'll feel better if she knows that her posts look like she's not shouting at everyone.

Thank you for sharing your code!

Sincerely,

Etymon
<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07