It looks good but the first line of the script should read:
form.INDEX_TO_DELETE = LISTSORT(form.INDEX_TO_DELETE,NUMERIC,DESC);
OR don't change it and use variables.INDEX_TO_DELETE in the rest of the code
-Oorspronkelijk bericht-
Van: Bosky, Dave [mailto:[EMAIL
Are you deleting backwards? If not, your code will not work. For
example, if you want to remove ites 2 and 4, if you first remove item 2,
the old item 4 is now item 3. If you go backwards (delete 4 then 2),
then this will not happen.
Once you use ArrayDeleteAt, the array is reindexed
try this :-)
cfset idlist = 1,2,3 /
cfset idlistsorted = ListSort(idlist) /
cfloop from=1 to=ArrayLen(myarray) index=i
cfset IDtoDelete = ListGetAt(idlistsorted ,i) - i /
cfset ArrayDeleteAt[IDtoDelete] /
/cfloop
justin
3 matches
Mail list logo