I keep getting a quite strange error in Dir 8 if I attempt to
access the 51th timer object stored in the timeoutList,
that's, for i = 51:

"Index out of range (the timeoutList[i]).forget()"

The code below may be used to try to reproduce the error.
I roughly embedded it pretty all into a startMovie handler, so it
needs a unique copy & paste operation. This is quite different
from the app I used 100 timers in, though the type of script into
which the code is located seems not affecting the reproduction
of the error.

In this code, the name of each timer is set equal to the index i
converted to string. The error occurs just for i = 51, mode = 1.
If mode <> 1 the objects are addressed by name instead of by their
index in the timeoutList, and this works regularly.

----------

on startMovie
  
  -- Fill timeoutList with 100 timers
  repeat with i = 1 to 100
    timeOut(string(i)).new(20, #getEv)   -- target left void
  end repeat
  cnt = the timeoutList.count()
  put cnt                                -- (that's 100)
  
  mode = 1    -- Set mode = 0 to address each object by name (no error)
  
  if mode = 1 then
    
    -- Empty the list by addressing each object by index - error
    repeat with i = 1 to cnt
      put i
      (the timeoutList[i]).forget()
    end repeat
    
  else
    
    -- Empty the list by addressing each object by name - no error
    repeat with i = 1 to cnt
      timeOut(string(i)).forget()
    end repeat
    
  end if
  
  -- Show the final content of the list (that's 0)
  put the timeoutList.count()
end


on getEv
  -- do nothing
end


Regards,

Franco

IFC Programming Consultant
http://www.chnexus.com/main.htm
Private mailto:[EMAIL PROTECTED]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to