Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFList question 1

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
I was wondering if there is a way I can either:
1) delete an entire list, and then save the list again with different values.
2) replace all values in the list with other values.

i tried (and both didn't work):
Code:
<cfloop index="FAList" from="1340" to="1343">
  [COLOR=green]<cfset FAList = listappend(FAList,trim(FormAnswer))>[/color]
    <cfloop list="#FAList#" index="i" delimiters="|,">
      <cfif findnocase(i,#badwordslist#)>
        <cfset badWordsstatus = badWordsstatus + 1>
      </cfif>
     </cfloop>
   [COLOR=red]<cfset FAList = ListDeleteAt(FAList,1)>[/color]
</cfloop>

Code:
<cfloop index="FAList" from="1340" to="1343">
  [COLOR=green]<cfset FAList = listappend(FAList,trim(FormAnswer))>[/color]
    <cfloop list="#FAList#" index="i" delimiters="|,">
      <cfif findnocase(i,#badwordslist#)>
        <cfset badWordsstatus = badWordsstatus + 1>
      </cfif>
     </cfloop>
   [COLOR=red]<cfset FAList = ReplaceList(trim(FormAnswer),FAList,trim(FormAnswer))>[/color]
</cfloop>

One thing to remember is that FormAnswer is a dB field. I am pulling all records from thr dB, putting one set in a list, checking for something, and then i'd like to add the next set after I either delete the first set OR replace the first set.

Any ideas?


____________________________________
Just Imagine.
 
A list is nothing but a string separated by commas or any other delimeter of your choosing.

try this
<cfset FAList="">

let me know how it goes, I'm 99% sure on that answer.

grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top