You can manage global variables using two different methods:
ØHEScript: Utilize the SetGlobalVar and GetGlobalVar functions for seamless control.
Global variables offer improved security and functionality compared to cookies, making them an ideal choice for data sharing in your publication.
Here are some key properties of global variables:
ØUnique Names: Global variable names must consist of alphanumeric characters without spaces. Avoid using names starting with "HE" to prevent conflicts with internal variables used by HTML Executable.
ØPersistence: Global variables can be either persistent or temporary. Persistent variables are saved in the publication's state file and loaded in subsequent sessions, while temporary variables exist only for the current session. You can set a variable's persistence using the SetGlobalVar method.
ØInstance Isolation: Global variables are not shared between multiple running instances of a publication. However, you can synchronize global variables across all instances by using the SynchronizeGlobalVar function.
HTML Executable provides several pre-defined global variables for various purposes. Here's a list of some commonly used ones:
Global Variable Name
When an error occurs, this variable contains the error message.
The title of the main window.
The index page's filename.
The path where the publication stores its data. You can customize it.
The path to a temporary location where the publication stores its external files temporarily. This will change each time.
Contains the device ID returned by Windows of the USB disk on which the publication EXE lies.
The title of the page which is currently displayed.
Is the forward button enabled? (true/false)
Is the back button enabled? (true/false)
The full path to the publication's .exe file (including filename)
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\).
Boolean (0 or 1). Indicates whether the publication is registered or not. 0 = Trial ; 1 = Registered. Only available in a Restricted Publication.
Contains the name of the registered user. Only available in a Restricted Publication.
Contains the company name of the registered user. Only available in a Restricted Publication.
Boolean (0 or 1). Indicates whether the trial period is over or not. Only available in a Restricted Publication.
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.
Contains the number of times the publication has been started in the trial period. Only available in a Restricted Publication with a trial period, based on number of runs.
Boolean (0 or 1). Tells you whether the publication is on a USB drive or not. In order to be used, GetManualHardwareID(1) must be invoked first. For example, using this global variable lets you decide whether a publication may be run or not.
Boolean (0 or 1). Enables the display of the navigation bookmark panel at startup: when the PDF is loaded, its bookmarks are automatically listed. By default, it is set to 0.
For enkySL dongles. Contains the trial frequency value.
For enkySL or enkyCT dongles. Contains the trial days value.
For enkySL or enkyCT dongles. Contains the authorization expiration date in year/month/day value.
⚠ Please note that you should only read the values of these variables and avoid setting their values yourself.
With these additional global variables, you have more tools at your disposal to customize and enhance your HTML Executable ebooks and applications.