Built-in Functions
Source file: built-in-functions.htm
The scripting API provides some built-in functions that can be used in your scripts.
| Function | Returns | Description |
isUndefined(x)
|
bool | Query if a value is undefined. |
isNumber(x)
|
bool | Query if a value is a number. Can be NaN, +/- infinity, or an ordinary number. |
isNaN(x)
|
bool | Query if a value is the NaN (not a number) numeric value. |
isInteger(x)
|
bool | Query if a value is an integer. |
isClose(x, y, tolerance)
|
bool | Query if two numeric values are within a specified tolerance of each other, that is Math.abs(x-y) < tolerance. |
fromCelsiusToKelvin(t)
|
number | Convert a number from degrees Celsius to Kelvin. |
fromKelvinToCelsius(t)
|
number | Convert a number from Kelvin to degrees Celsius. |
fromFahrenheitToKelvin(t)
|
number | Convert a number from degrees Fahrenheit to Kelvin. |
fromKelvinToFahrenheit(t)
|
number | Convert a number from Kelvin to degrees Fahrenheit. |
message(msg[,params])
|
undefined |
Outputs an informational message when running the script. Execution of the script continues after calling this function. Note: Note: Messages prefixed with |
error(msg[,params])
|
undefined |
Raises an error, aborting further execution of the script. This will cancel calculating of the charge plan for the current hole. Note: |
assert(condition[,msg])
|
undefined | Check that condition evaluates to true.
Raises an AssertionError exception if condition is false.
Note: |