Link to home
Create AccountLog in
Avatar of nmarano
nmarano

asked on

creating a new list

Experts-

I am trying to create a new list and am looking for some help.


          <cfset mycorrectList = '1,2,3,4,5,6,7,8,9,10'>
      <cfset mystudentList = '1,2,3,4,10'>
   
          <cfif listfind(mystudentList,mycorrectList)>
       .....Here I want to be able to delete the element if it is found and create a new list that would look like this..

<cfset mynewestList = '5,6,7,8,9'>

Can I use listDeleteAt?  Not knowing where the element is located in my list doesn't allow me to use this does it?  Any help would be appreciated

Thanks
Nick

              
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of nmarano
nmarano

ASKER

Thanks I'll try that out
Avatar of nmarano

ASKER

Thanks!  I had it set similar except I was missing the eq 0
<cfloop index="i" list="#myCorrectList#">
    <cfif listFind(myStudentList, i)><!--- was missing eq 0 here --->
        <cfset newList = listAppend(newList, i)>
    </cfif>
</cfloop>