Functions Editor

Menu option: Advanced: Edit Functions
See also:
CALL function

In addition to LEAP's built-in library of functions, you can also write your own functions in standard scripting languages such as VBScript, JScript, Python, Perl or Ruby.  These functions can be accessed from your expressions using the CALL function.  The functions editor lets you edit the default VBScript file (functions.vbs), which is stored in the current area folder.  Thus, you can have different functions specified in different areas,  More information on Windows VBScript is available here.

A trivial example function is shown here:

Function Add(x,y)
Add = x + y
End Function

Notice that each function starts with the keyword Function and ends with the Keywords End Function.  Function results are set by assigning values to the function name (in this case Add).  LEAP functions should always return numeric values (integer or floating point) and should always use numeric parameters.  Functions can have any number of parameters, but the onus is on the user to pass the correct number of parameters in a comma separated list in the CALL statement.

In the functions editor, use the Save button to save the functions.  The editor supports standard editing options such as cut, copy, paste, undo,   find (Ctrl-F) and find again (F3).