duh, what a backward way of doing it i just posted!
better way:
<cfscript>
str="i HAVE MY CAPS LOCK ON BY MISTAKE!";
ucasecount = len(rereplace(str,"[^A-Z]","","ALL"));
lcasecount = len(rereplace(str,"[^a-z]","","ALL"));
if(ucasecount gt lcasecount){
writeoutput("More uppercase ("&ucasecount&") than lowercase ("&lcasecount&")
characters found. you might be SHOUTING.");
}
</cfscript>
-----Original Message-----
From: Kerry [mailto:[EMAIL PROTECTED]
Sent: 24 October 2005 19:19
To: CF-Talk
Subject: RE: stop: SHOUTING
what about comparing number of uppercase characters to number of lowercase?
<cfscript>
str="i HAVE MY CAPS LOCK ON BY MISTAKE!";
str=rereplace(str,"[^a-zA-Z]","","ALL");
ucasecount = len(rereplace(str,"[a-z]","","ALL"));
lcasecount = len(rereplace(str,"[A-Z]","","ALL"));
if(ucasecount gt lcasecount){
writeoutput("More uppercase ("&ucasecount&") than lowercase ("&lcasecount&")
characters found. you might be SHOUTING.");
}
</cfscript>
-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: 24 October 2005 19:12
To: CF-Talk
Subject: Re: stop: SHOUTING
<cfset theWord = form.UserInput />
<cfif compare(form.UserInput, ucase(form.UserInput)) EQ 0> <-- word is all
caps
might be able to build on that?
On 10/24/05, Adkins, Randy <[EMAIL PROTECTED]> wrote:
> There maybe another way but you could always check the ASCII values.
> Lowercase and UPPERCASE have different values.
>
> However checking this for each letter in a TEXTAREA is quite a bit.
>
> Sure there is another way.. Hopefully someone has an easy answer.
>
> -----Original Message-----
> From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 24, 2005 2:03 PM
> To: CF-Talk
> Subject: stop: SHOUTING
>
> Hi guys,
>
> Just wondering if anyone knows a good way to recognise when all the
> characters are capitalised? Some users love putting text in CAPS and it
> just looks awful when it's displayed on screen.
>
> Any help I'd be grateful.
>
> Thanks,
>
> Saturday
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222108
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54