n scheme is a setting for the web site. It is saved to the web site permanently until changed. It is usually used to specify constant settings which is referenced from the program code. Scheme values are loaded into the client session when it starts. Any changes to scheme values only affect the current session, and they will be all discarded after the session finish (e.g. browser close).
Scheme values can be explicitly reloaded (via "scheme reload") and saved (via "scheme save"). Once saved, the scheme values will be stored with the web site. However, other sessions will not pick up the changes unless the reload the scheme. If file& (except for "list&") is specified after scheme%, the settings in the specified scheme file will be used instead of the common site scheme file. In this case, the changes will be reloaded every time they are used, and saved immediately upon changes (which means all sessions will pick up the changes.)
There is a special scheme operation: "scheme%file&" without the name part. This itself returns a list of names in the scheme files. In addition, it has a "side-effect" of loading all scheme values in the scheme file into "file%name:element". That way, you can load the whole scheme file into a class under the Context in one go. e.g. "var scheme%file&;". (file must not be "list".)
There is yet another special scheme variable: "scheme%list&" (no name part). This array contains the list of all scheme files (including the default "scheme") of the web site.
General scheme settings (scheme%name) are usually used for common settings that require fast access and local update. Specific scheme files (scheme%file&name) are usually used to hold design parameters that require little or no updates, to simplify the coding. For example, you can store form field attributes and validation criteria into scheme files for the program to interpret while displaying a form.
Only get and set operations can be applied to scheme variables (both general and specific scheme file). You cannot clear a scheme variables (but you can set it to "").
|