<cfscript>
function sizeOf(var1){
return len(var1.getbytes());
}
<cfscript>


That should do the trick... getbytes returns a byte array so the len
of it I think should give you the bytes in your string.

Adam H 

On Mon, 7 Feb 2005 22:49:12 -0500, Jim Davis
<[EMAIL PROTECTED]> wrote:
> > -----Original Message-----
> > From: Bettina Gill [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 07, 2005 9:33 PM
> > To: CF-Talk
> > Subject: Re: How can I get the size in bytes/bits of something?
> >
> > ><cfset x = "HelloWorld" />
> > ><cfset bytes = sizeof(x) />
> >
> > You're probably looking for the LEN() function, i.e. bytes=LEN(x)...
> 
> That's close... but in Java (and thus CFMX+) I believe that you should
> double that for "byte size" as Unicode character sets use two bytes per
> character.
> 
> Jim Davis
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193572
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

Reply via email to