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(
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
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
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 =
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 =
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
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,
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
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
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
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$
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#
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
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
14 matches
Mail list logo