CloudAppSet

Description

Configures the settings for the pictures loaded via URL in the PowerClient- or PowerServer-deployed applications.

Syntax

Integer CloudAppSet (string n, string v)

Argument

Description

n

The name of the setting that is case insensitive. The setting can be:

  • picturecachepath -- The directory where pictures are cached after downloaded from Web. The default value is "/picturecache". The leading forward slash (/ or //) indicates the root of the current application directory.

    Both the relative path and absolute path are supported. The path can also contain the system environment variable such as %appdata%\picturecache.

  • clearpicturecacheonclose -- Whether to delete pictures from the cache directory when the application is closed.

  • checkpictureforupdate -- Whether to check updates for the existing pictures. If pictures on Web have been updated, they will be downloaded again to the cache directory, otherwise, the picture in the cache directory will be used.

    The file size of the picture on Web will be obtained and compared with the file size of the picture in the cache directory. If the size is different, it indicates the picture has been updated on Web, and the picture will be downloaded again to the cache directory.

v

The value of the setting to be set.

  • When the name of the setting is "picturecachepath", the value can be a directory.

  • When the name of the setting is "clearpicturecacheonclose", this value can be "true" or "false".

  • When the name of the setting is "checkpictureforupdate", this value can be "true" or "false".


Return value

Integer.

Returns 1 if the function succeeds and the following negative value if an error occurs.

-1 The application is not a PowerClient- or PowerServer-deployed app.

-2 The name of the setting does not exist or is invalid.

-3 The value of the setting is invalid. The value that was successfully set last time or the default value will be used instead.

Examples

CloudAppSet ("picturecachepath", "/picturecache");
CloudAppSet ("clearpicturecacheonclose", "true");
CloudAppSet ("checkpictureforupdate", "true");

See also

CloudAppGet