Re: CFLOOP: Almost there ...

2007-07-06 Thread Dominic Watson
I'vew just checked the CFTalk archives and it seems my repsonse got cut off, perhaps its the way gmail writes its HTML or something. Anyway, as I was saying, the CFLOOP version might look something like this: cfloop index = VotedElement list = #FORM.vote# cfset position = ListFind(

Re: CFLOOP: Almost there ...

2007-07-06 Thread coldfusion . developer
cfloop index = VotedElement list = #FORM.vote# cfset position = ListFind( FORM.allidslist, VotedElement ) cfif position cfset FORM.allidslist = ListDeleteAt(FORM.allidslist, position) /cfif /cfloop Here's what I have and what I get ... I've spent way too much time on

Re: CFLOOP: Almost there ...

2007-07-06 Thread coldfusion . developer
correction ... first 8 next to FORM.allidslist_new was missing. #FORM.vote# = 8,9,12 FORM.allidslist = 8,9,12,13,14,15,16,17,18,19,20,21,22,23,24 FORM.allidslist_new = 8,9,13,14,15,16,17,18,19,20,21,22,23,24 ~| Upgrade to Adobe

Re: CFLOOP: Almost there ...

2007-07-06 Thread Dominic Watson
When you call ListDeleteAt() you do not change the value of the first argument (FORM.allidslist) so each iteration of your loop starts again with the full list of IDs. Do this instead if you want to use that 3rd form variable: cfloop index = VotedElement list = #FORM.vote# cfset position =

Re: CFLOOP: Almost there ...

2007-07-06 Thread Dominic Watson
Sorry I made a mistake in the first snippet. Should be: cfset FORM.allidslist_new = FORM.allidslist cfloop index = VotedElement list = #FORM.vote# cfset position = ListFind(FORM.allidslist_new, VotedElement ) cfif position cfset FORM.allidslist_new =

Re: CFLOOP: Almost there ...

2007-07-06 Thread coldfusion . developer
You rock! It worked. Thank you. Sorry I made a mistake in the first snippet. Should be: cfset FORM.allidslist_new = FORM.allidslist cfloop index = VotedElement list = #FORM.vote# cfset position = ListFind(FORM.allidslist_new, VotedElement ) cfif position cfset

Re: CFLOOP: Almost there ...

2007-07-05 Thread Dominic Watson
Try this: cfscript aVote = ListToArray(form.vote); aAllIDs = ListToArray(form.allidslist); aAllIDs.RemoveAll(aVote); /cfscript And check this out if you want to know why it works: http://coldfused.blogspot.com/2007/01/extend-cf-native-objects-harnessing.html Alternatively,

Re: CFLOOP, almost there

2003-06-04 Thread Michael Dinowitz
Will the email address always be after the name on the line in that way? No brackets or anything? nothing else on the line? If so, A fast RegEx can do it. Can you show a complete sample page (on a site somewhere maybe)? Hi, I I need is some code that will strip out the e-mail address. Ingar

Re: CFLOOP, almost there

2003-06-04 Thread CF Dude
Here's how I did this in the past, but it was in other web langs 1.Set block of emails into sText var 2.Split sText into array using ' ' space as delimiter 3.Loop through array 4.Check each key in array for existence of @ 5.Append each key w/@ in it to newEmailArray or newEmailList 6.Loop through

RE: CFLOOP, almost there

2003-06-04 Thread Lofback, Chris
Something like this? CFSET CRLF = Chr(13) Chr(10) CFLOOP LIST=#emailtext# DELIMITERS=#CRLF# INDEX=TheLine CFSET EmailItem = ListContains(TheLine,@, ) CFIF EmailItem CFSET EmailAddress = ListGetAt(TheLine, EmailItem , ) !--- Do whatever you want

Re: CFLOOP, almost there

2003-06-04 Thread CF Dude
Aren't there any string functions that would take a string and parse out an e-mail address? I'm not aware of any parseEmail() functions that are built in, but this is just a standard text parsing task. I don't know how to deal with arrays! Sounds like you need to get your learn on! E$

RE: CFLOOP, almost there

2003-06-04 Thread coldfusion . developer
Great! This is the closest I've come yet. The problem is the number of charactors on each liine isn't the same. so some lines, I get just the e-mail, others I get the last name and the e-mail address. So close! Something like this? CFSET CRLF = Chr(13) Chr(10) CFLOOP LIST=#emailtext#

RE: CFLOOP, almost there

2003-06-04 Thread Lofback, Chris
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 2:27 PM To: CF-Talk Subject: RE: CFLOOP, almost there Great! This is the closest I've come yet. The problem is the number of charactors on each liine isn't the same. so some lines, I get

RE: CFLOOP, almost there

2003-06-04 Thread Bryan Love
Paine, The American Crisis Let's Roll - Todd Beamer, Flight 93 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 11:27 AM To: CF-Talk Subject: RE: CFLOOP, almost there Great! This is the closest I've come yet. The problem