Re: How do you get middle 4 numbers out of agent code number
This code below works great, but how bout if you wanted the second set of 4 numbers from the left. i.e. Lets say someone provides an agent number of ' 123456789123' and it needs to be split into 3 parts with 4 charcters each: Master=1234 Region=5678 Agent=9123 Because there is a signup process where a 12 digit number needs to be broken down into 3 pieces. Thanks. Can't you just use left and right? Like: cfset FORM.ccnumber = trim(FORM.ccnumber) cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4) cfset rightnumbers = right(FORM.ccnumber, 4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 5:14 PM To: CF-Talk Subject: Split up a credit card number? Need regex handout! Hello everyone, I need to take a given form field (numbers) and break it into 2 parts. Then insert one part, and cfmail the other. The number can be different lengths. For example: 3939 may get passed by a form field. I need to insert the 3939 to a DB, and cfmail the . I must admit that I'm stuck on this one, I can't even get a good working start. I can take the number and replace the first 4 digits with nothing, which will give me the second half. But then how to get the first 4 digits? Am I going about this the wrong way? Is there a better approach? Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] _ Composed on Wednesday, February 13, 2002, at 4:58:30 PM __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How do you get middle 4 numbers out of agent code number
use mid() Bryan Stevenson VP Director of E-Commerce Development Electric Edge Systems Group Inc. p. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 3:17 PM Subject: Re: How do you get middle 4 numbers out of agent code number This code below works great, but how bout if you wanted the second set of 4 numbers from the left. i.e. Lets say someone provides an agent number of ' 123456789123' and it needs to be split into 3 parts with 4 charcters each: Master=1234 Region=5678 Agent=9123 Because there is a signup process where a 12 digit number needs to be broken down into 3 pieces. Thanks. Can't you just use left and right? Like: cfset FORM.ccnumber = trim(FORM.ccnumber) cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4) cfset rightnumbers = right(FORM.ccnumber, 4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 5:14 PM To: CF-Talk Subject: Split up a credit card number? Need regex handout! Hello everyone, I need to take a given form field (numbers) and break it into 2 parts. Then insert one part, and cfmail the other. The number can be different lengths. For example: 3939 may get passed by a form field. I need to insert the 3939 to a DB, and cfmail the . I must admit that I'm stuck on this one, I can't even get a good working start. I can take the number and replace the first 4 digits with nothing, which will give me the second half. But then how to get the first 4 digits? Am I going about this the wrong way? Is there a better approach? Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] _ Composed on Wednesday, February 13, 2002, at 4:58:30 PM __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: How do you get middle 4 numbers out of agent code number
Then you would use Mid() Mid(string, start, length) Leftnumbers = left(string, 4) Middlenumbers = mid(string,5,4) Rightnumbers = right(string,4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 6:17 PM To: CF-Talk Subject: Re: How do you get middle 4 numbers out of agent code number This code below works great, but how bout if you wanted the second set of 4 numbers from the left. i.e. Lets say someone provides an agent number of ' 123456789123' and it needs to be split into 3 parts with 4 charcters each: Master=1234 Region=5678 Agent=9123 Because there is a signup process where a 12 digit number needs to be broken down into 3 pieces. Thanks. Can't you just use left and right? Like: cfset FORM.ccnumber = trim(FORM.ccnumber) cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4) cfset rightnumbers = right(FORM.ccnumber, 4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 5:14 PM To: CF-Talk Subject: Split up a credit card number? Need regex handout! Hello everyone, I need to take a given form field (numbers) and break it into 2 parts. Then insert one part, and cfmail the other. The number can be different lengths. For example: 3939 may get passed by a form field. I need to insert the 3939 to a DB, and cfmail the . I must admit that I'm stuck on this one, I can't even get a good working start. I can take the number and replace the first 4 digits with nothing, which will give me the second half. But then how to get the first 4 digits? Am I going about this the wrong way? Is there a better approach? Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] _ Composed on Wednesday, February 13, 2002, at 4:58:30 PM __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How do you get middle 4 numbers out of agent code number
Take a look at the mid function. The syntax is cfset rs = mid(string, start, count) So you could do something like this... cfset agentNumber = '123456789123' cfset master = mid(agentNumber, 1, 4) cfset region = mid(agentNumber, 4, 4) and so on. jon - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 6:17 PM Subject: Re: How do you get middle 4 numbers out of agent code number This code below works great, but how bout if you wanted the second set of 4 numbers from the left. i.e. Lets say someone provides an agent number of ' 123456789123' and it needs to be split into 3 parts with 4 charcters each: Master=1234 Region=5678 Agent=9123 Because there is a signup process where a 12 digit number needs to be broken down into 3 pieces. Thanks. Can't you just use left and right? Like: cfset FORM.ccnumber = trim(FORM.ccnumber) cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4) cfset rightnumbers = right(FORM.ccnumber, 4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 5:14 PM To: CF-Talk Subject: Split up a credit card number? Need regex handout! Hello everyone, I need to take a given form field (numbers) and break it into 2 parts. Then insert one part, and cfmail the other. The number can be different lengths. For example: 3939 may get passed by a form field. I need to insert the 3939 to a DB, and cfmail the . I must admit that I'm stuck on this one, I can't even get a good working start. I can take the number and replace the first 4 digits with nothing, which will give me the second half. But then how to get the first 4 digits? Am I going about this the wrong way? Is there a better approach? Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] _ Composed on Wednesday, February 13, 2002, at 4:58:30 PM __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: How do you get middle 4 numbers out of agent code number
Thankyou very much, that worked like a charm. - Original Message - From: Steve Oliver [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 3:22 PM Subject: RE: How do you get middle 4 numbers out of agent code number Then you would use Mid() Mid(string, start, length) Leftnumbers = left(string, 4) Middlenumbers = mid(string,5,4) Rightnumbers = right(string,4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 6:17 PM To: CF-Talk Subject: Re: How do you get middle 4 numbers out of agent code number This code below works great, but how bout if you wanted the second set of 4 numbers from the left. i.e. Lets say someone provides an agent number of ' 123456789123' and it needs to be split into 3 parts with 4 charcters each: Master=1234 Region=5678 Agent=9123 Because there is a signup process where a 12 digit number needs to be broken down into 3 pieces. Thanks. Can't you just use left and right? Like: cfset FORM.ccnumber = trim(FORM.ccnumber) cfset leftnumbers = left(FORM.ccnumber, len(FORM.ccnumber) - 4) cfset rightnumbers = right(FORM.ccnumber, 4) __ steve oliver atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 5:14 PM To: CF-Talk Subject: Split up a credit card number? Need regex handout! Hello everyone, I need to take a given form field (numbers) and break it into 2 parts. Then insert one part, and cfmail the other. The number can be different lengths. For example: 3939 may get passed by a form field. I need to insert the 3939 to a DB, and cfmail the . I must admit that I'm stuck on this one, I can't even get a good working start. I can take the number and replace the first 4 digits with nothing, which will give me the second half. But then how to get the first 4 digits? Am I going about this the wrong way? Is there a better approach? Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] _ Composed on Wednesday, February 13, 2002, at 4:58:30 PM __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists