ftp again

Andre Garzia soapdog at mac.com
Tue Sep 7 18:25:16 EDT 2004


Rand,

it's pretty easy! :D

do like this use your code libURLDownloadToFile <something>, 
"downloadCompleted"

then put a handler in the same object called downloadCompleted:

on downloadCompleted pTheURL, pTheStatus
     answer pTheURL && pTheStatus
end downloadCompleted


in that handler you can start the download of your next file, you can 
use a field for that. each time downloadCompleted is called, it will 
check pTheStatus to see if it is good, then will remove the first line 
of the field, then it will download the "new first line" (aka the 
second), if the field is empty then exit... it's like the recursion 
technique.

if you need further assistance.
Andre



On Sep 7, 2004, at 7:04 PM, rand valentine wrote:

> 2. a libURLDownloadToFile downloadURL,filePath[,callbackMessage] 
> command.
>
>  Now I like the idea of this latter option, since I could use the
> callbackMessage part of the structure to check and see that a file has 
> been
> successfully downloaded before proceeding. But it isn't clear at all 
> to me
> how this callbackMessage is to be monitored. Let's say you have a 
> scriptline
>
> libURLDownloadToFIle <something>
>
>  Right after this I need to use the callbackmessage, right, to check 
> and see
> that the file is downloaded. How do I script the callbackmessage part,
> something to the effect of
>
> wait until myCallbackmessage
>
>  From what I've read of the docs, "wait" structures are decided no-no, 
> but
> the documentation is not at all clear to my humble as to how you 
> _properly_
> use a callbackMessage in a script. Oddly, the documentation tells you 
> what
> _not_ to do, but doesn't do a very clear job of telling _what_ to do.
>
>  Thank you so much for your help.
>
-- 
Andre Alves Garzia ð 2004 ð BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list