Applies to HTML Viewer, IE Browser publications. Global variables can be used by HEScript and JavaScript scripts to share data and store values in the publication. Each HEScript script is run separately by a single engine, so they cannot share variables: you need to use global variables if you want to share data between two scripts for instance. You can manage global variables using:
The properties The names of global variables are unique and must contain only alphanumeric characters (without any space). In general, your global variables should never begin with "HE" because such variables may be used internally by HTML Executable.
Global variables may be persistent or temporary; a persistent variable is stored in the publication, in other words the variable and its value are saved in the publication's state file and loaded the next time the publication is run. A temporary variable will exist only for the current session. You determine whether a variable is persistent or not when you set its value using the SetGlobalVar method.
Global variables are not shared between several running instances of a publication, but you can force all of the instances to have the same global variables by calling the SynchronizeGlobalVar function.
List of pre-defined global variables| Global Variable Name | Description |
|---|
| HELasterrormessage | When an error occurs, this variable contains the error message. | | DefWinTitle | The title of the main window. | | HomePage | The index page's filename. | | HEPubStorageLocation | The path where the publication stores its data. | | HEPubTempPath | The path to a temporary location where the publication stores its external files temporarily. This will change each time. | | CurPageTitle | The title of the page which is currently displayed. | | FwdButtonEnabled | Is the forward button enabled? (true/false) | | BackButtonEnabled | Is the back button enabled? (true/false) | | IEHighLightResults | Boolean (0 or 1, 1 by default). If set to 1, search words will be highlighted in an IE browser publication. | | LastSearchQuery | The last search query. | | HEPublicationFile | The full path to the publication's .exe file (including filename) | | HEPublicationPath | The full path to the folder that contains the publication's .exe file (no filename). It will always include the path trailing backslash (e.g. C:\MyPath\). | | HEPubRegistered | Boolean (0 or 1). Indicates whether the publication is registered or not. 0 = Trial ; 1 = Registered. Only available in a Restricted Publication. | | HEPubUserName | Contains the name of the registered user. Only available in a Restricted Publication. | | HEPubUserData1 | Contains the company name of the registered user. Only available in a Restricted Publication. | | HEPubExpired | Boolean (0 or 1). Indicates whether the trial period is over or not. Only available in a Restricted Publication. | | HEPubDays | Contains the number of remaining days in the trial period. Only available in a Restricted Publication with a trial period, based on number of days. | | HEPubRuns | Contains the number of remaining runs in the trial period. Only available in a Restricted Publication with a trial period, based on number of runs. | | HEURLShowInPopupTitle | Boolean (0 or 1). Allows IE publications to display URLs in popup titles. If set to 1, if you display an external website in a popup window, the popup will bear the URL to that website until it is completely loaded. |
You should only read the values of these variables and not set their values yourself, except for IEHighLightResults & HEURLShowInPopupTitle. How to call HEScript procedures/functions?
|