ok here is my code, I've added what your bits too in it.

<HTML><HEAD><META HTTP-EQUIV="REFRESH" CONTENT="2"><TITLE>Monitor</TITLE></HEAD>
<BODY>
<CFSET TheList = "#lName#">

<TABLE>
<TR>
<cfset BackupList=TheList>
<CFLOOP FROM="1" TO="1" STEP="1" INDEX="temp">
  <cfset Position = RandRange(1,ListLen(TheList))>
  <cfset DisplayItem=ListGetAt(TheList,Position)>
  <cfset tempVar=ListDeleteAt(TheList,Position)>
  <cfif ListLen(TheList) EQ 0>
     <cfset TheList=BackUpList>
  </cfif>
  <TD><cfoutput>#DisplayItem#</cfoutput></TD>
  <!--- <TD><CFOUTPUT>#ListGetAt(TheList,Position)#</CFOUTPUT></TD>
  <CFSET TheList = ListDeleteAt(TheList,Position)>  --->
</CFLOOP>
</TR>
</TABLE>
</BODY>
</HTML>

Now each time the page refreshes, the list will be reinitialised to its original length, right. So your logic does'nt ever get executed, does it? the list length will never be set to 0?

Sorry for pestering you!

>At 11:08 AM 10/12/2003 -0400, cf coder wrote:
>>Thane Sherrington wrote:
>>(Of course, you'd want to save the original list so you could start over
>>once you had finished one pass through the list.)
>>
>>How do I save the original list?
>
>First create your list, then do something like:
><cfset BackupList=TheList>
>That will give you two lists, each identical.
>
>Each time you loop through TheList variable and delete a list item, you can
>check and see if there is anything left - if TheList is empty, recreate it
>from BackupList.
>
><cfif ListLen(TheList) EQ 0>
>         <cfset TheList=BackUpList>
></cfif>
>
>T
>
>Tired of your bookmarks/favourites being limited to one computer?  Move
>them to the Net!
>www.stuffbythane.com/webfavourites makes it easy to keep all your
>favourites in one place and
>access them from any computer that's attached to the Internet.
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to