RE: Having problems with LEN()...

2007-06-27 Thread Bobby Hartsfield
Subject: Re: Having problems with LEN()... and when that doesn't work, try it with 0's :) On 6/26/07, Bobby Hartsfield [EMAIL PROTECTED] wrote: Try Numberformat(var, '') ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From

RE: Having problems with LEN()...

2007-06-26 Thread Peterson, Chris
Use #numberformat(myReorderNumber, )# That will auto-prepend 0's if necessary Chris Peterson Gainey IT Adobe Certified Advanced Coldfusion Developer -Original Message- From: Michael Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 1:21 PM To: CF-Talk Subject:

Re: Having problems with LEN()...

2007-06-26 Thread Charlie Griefer
fails miserably and blows up are kinda vague. got an error message? but a couple of points: 1) look up the numberFormat() function. you can pad a number with leading zeros. seems cfset order_number = numberFormat(form.reorder, '') / should be all the logic you need. 2) you've got

Re: Having problems with LEN()...

2007-06-26 Thread Scott Weikert
Do a conditional loop. cfloop condition=Len(var) LT 8 cfset var = 0 var /cfloop Just keeps adding zeroes onto the front 'til the length is 8. ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7

Re: Having problems with LEN()...

2007-06-26 Thread Charlie Griefer
and when that doesn't work, try it with 0's :) On 6/26/07, Bobby Hartsfield [EMAIL PROTECTED] wrote: Try Numberformat(var, '') ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Michael Stevens [mailto:[EMAIL PROTECTED]

Re: Having problems with LEN()...

2007-06-26 Thread Claude Schneegans
You could try simplifying it with a CFSWTCH/CFCASE statement instead... Or more simply: cfset Order_Number = left(00, 8 - len(form.reorder)) form.reorder or: cfset Order_Number = repeatString(0, 8 - len(form.reorder)) form.reorder or: cfset Order_Number =

Re: Having problems with LEN()...

2007-06-26 Thread James Buckingham
What do you mean by it fails miserably?. You could try simplifying it with a CFSWTCH/CFCASE statement instead... cfswitch expression=#len(form.reorder)# cfcase value=4 cfset Order_Number = / /cfcase cfcase value=5 cfset

Re: Having problems with LEN()...

2007-06-26 Thread James Buckingham
Hi Mike, What do you mean by it fails miserably? Personally I would probably write that differently because it does look a bit messy with so many len() checks. Suggestions could be: Use CFSWITCH/CFCASE. Although it would do the same thing as your if statements it would be a lot cleaner and

RE: Having problems with LEN()...

2007-06-26 Thread Bobby Hartsfield
Try Numberformat(var, '') ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Michael Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 1:21 PM To: CF-Talk Subject: Having problems with LEN()... My page takes input