Error getting tags :
error 404Error getting tags :
error 404 load | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
load
Basics
Expander triangle
Type
Command
Syntax
load [URL] url [with message callbackMessage]
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
Network
Summary
Downloads the file specified by a URL to a cache where it can be used by another handler.
Examples

load URL "http://www.example.com/index.html"
load URL myURL with message "downloadComplete"

Additional Comments
Expander triangle

Use the load command to pre-fetch a file from the Internet in order to speed up access when using it in an expression with the URL keyword.

Parameters:

The url is any valid http or ftp URL.

The callbackMessage is the name of a message to send after the URL is loaded.

Comments:

To use a file that has been downloaded by the load command, refer to it using the URL keyword as usual. When you request the original URL, Revolution uses the cached file automatically.

The callbackMessage is sent to the object whose script contains the load command, after the URL is loaded, so you can handle the callbackMessage to perform any tasks you want to delay until the URL has been cached. Two parameters are sent with the message: the URL and the URLStatus of the file.

The load command is non-blocking, so it does not stop the current handler while the download is completed. The handler continues while the load command downloads the URL in the background. You can monitor the download by checking the URLStatus function periodically.

Caution! Avoid using the waitcommand in a handler after executing the loadcommand. Since the loadcommand is non-blocking, it may still be running when your handler reaches the waitcommand. And since the load command is part of the Internet library and is implemented in a handler, the waitcommand will stop the download process if it is executed while the download is still going on. In particular, do not use constructions like the following, which will sit forever without downloading the file:

load URL myURL

wait until the URLStatus of myURL is "cached" -- DON'T DO THIS

The file is downloaded into a local cache. It does not remain available after the application quits; the purpose of the cache is to speed up access to the specified URL, not to store it permanently. You can use a URL even if it is not in the cache, so use of the load command is optional.

Note:cachedfiles consume memory. To release this memory after you are finished with a URL, use the unloadcommand to remove it from the cache.

Important! The loadcommand is part of the Internet library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions section of the Standalone Application Settings window, make sure "Internet Library" is selected in the list of script libraries.

Note: When included in a standalone application, the Internet library is implemented as a hidden group and made available when the group receives its first openBackground message. During the first part of the application's startup process, before this message is sent, the loadcommand is not yet available. This may affect attempts to use this command in startup, preOpenStack, openStack, or preOpenCardhandlers in the main stack. Once the application has finished starting up, the library is available and the loadcommand can be used in any handler.

User Comments
Expander triangle