HTML Executable Script Editor

Applies to HTML Viewer, IE Browser publications.

The Script Editor is the main place where you edit HEScript scripts.

imgYou can create, remove, import and export scripts with the Script Manager.

imgTo edit a script, just select it in the Script Manager and click Edit. You can also directly double-click on the desired script.

Note that the script editor is also automatically displayed when you import a script.

imgThe script editor looks like this:

img

The script appears in the main edit box.

Description of the behavior

imgThe script editor automatically highlights the syntax. Pascal keywords are in bold, comments in italic.

imgJust make your modifications to the script. Then to ensure there is no error, click on Check in the toolbar.

The Check command actually pre-compiles the script in order to ensure there is no syntax error. Thus you can easily find errors:

  • if the script does not contain any error, you get this answer: "Script successfully compiled".

  • otherwise you will receive an error. The error reason and location in source code are given:

    img

    And the line containing the error is marked with red:

    img

    Fix the problem (here you just add a semicolon ";" after OnPageLoaded.
    Press Check again and the red color will disappear.

imgYou can access the various editing commands such as Undo, Redo, Cut, Copy, Paste, Find, Replace... using the Menu button (or the mouse context menu).

imgWhen your modifications are finished, you can save the script by clicking Save. Before the script is saved, it is first pre-compiled (like if you clicked on Check) and only if it does not contain any syntax error, the editor is closed and the script is saved. If an error is found, the script editor will not close! If you want to close the editor without saving, click on Discard.

imgOnly error-free scripts can be saved to the project: that's why scripts are first pre-compiled when you click on Save or when scripts are imported. This is for security: since scripts are definitively compiled and linked during the publication's compilation, it is better that they are already syntax-error-free (at least).

imgThe Help button lets you access to these help topics.

img

The fact that a script is syntax-error-free does not guarantee that it will perfectly work! You must always test your publications and see that your scripts work fine!

img Introduction to Scripting

img Using the Script Manager

img Script Function Reference