load, url and repeat

Dar Scott dsc at swcp.com
Sat Jan 3 12:02:30 EST 2004


On Saturday, January 3, 2004, at 08:42 AM, Ludovic Thébault wrote:

> on mouseup
> repeat with n=1 to 810
>     put "http://domain.com/page.php?ID="&n into turl
>     load url turl

       wait 10 milliseconds with messages -- or some variation

>     put n&&the urlstatus of turl&cr after msg
>     if the urlstatus of turl = "cached" then downloadcomplete
> end repeat
> end mouseup

Note:  This will allow event messages, too.  You might want to use a 
busy flag and ignore the mouseUp on this object if it is busy; you 
don't want to nest your "load url" attempts.

It would be nice if there was a wait that only let through pending 
messages of some class or level or something.

However, this is not the best way to do this.  I'd use the 'with 
message' option to call downloadcomplete.  It is sent to the target, or 
was the last I checked.  If you do use this in a button, this is fine.

Dar Scott



More information about the use-livecode mailing list