XojoScript.Precompile

From Xojo Documentation
Jump to: navigation, search
Method

XojoScript.Precompile(optimizationLevel As OptimizationLevels) As Boolean

Runs the parser immediately instead of waiting until the next call to Run. Specify the optimizationLevel using the OptimizationLevels enumeration described below. Returns True if the optimization succeeded, False if there was an error.

Notes

Use the OptimizationLevels enumeration to specify optimization level to use to compile the script before running it.

Optimization Level Description
None No optimizations will be performed and the script will be compiled lazily (a JIT). Your script will start quickly, but will run more slowly than the other two optimization levels. This is the default if you do not precompile before calling Run.
Low The script will be compiled up front, but few optimizations will be applied. It will take longer for your script to start, but it will run more quickly.
High The script will be compiled up front and all possible optimizations should be ran. This will take the most time to compile the script, but it will run the quickest.

Example

This precompiles a script with an optimization level of "High" before it runs:

If XojoScript1.Precompile(XojoScript.OptimizationLevels.High) Then
XojoScript1.Run
End If
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About