Web Delivery

Chipp Walters chipp at chipp.com
Thu Jul 22 19:58:31 EDT 2004


Gordon,

You can download the stack and store it on your disk in one fell swoop.

Consider the following:

on startStack pStackFile

   put "C:/myfolder/" into tFolderPath
   put pFolderPath & pStackFile into tFilePath

   if there is a file tFilePath then
     --> STACK EXISTS SO OPEN IT
     open stack tFilePath
   else
     --> NO STACK FOUND SO DOWNLOAD IT FROM THE INTERNET
     put "http://www.mydomain.com/" into tURLfolder
     put tURLfolder & pStackFile into tURLfile

     --> DOWNLOAD THE FILE
     put URL tURLfile inot URL ("binfile:" & tFilePath)

     --> CHECK TO SEE IF THERE WERE ANY ERRORS
     put the result into tResult
     if tResult is not empty then
       answer warning tResult
     end if

     --> MAKE SURE THE STACK EXISTS BEFORE OPENING
     if there is a stack tFilePath then
        open stack tFilePath
     else
       --> PROBLEM
       answer warning "Can't find file: " & tFilePath
     end if

end startStack

Of course you can add your own versioning to this as well. The error 
handling could also be a bit more robust, but you get the idea.

(this is all from memory and hasn't been tested, but IMO should run)

-Chipp


More information about the use-livecode mailing list