Difference between revisions of "Trigger Functions"

From HIVE
Jump to navigation Jump to search
 
m (1 revision: StarEdit.net Wiki)
(No difference)

Revision as of 06:16, 21 November 2010

A Trigger Function contains Trigger code that can be called wherever it is needed. It's used to modularize your code and reusing it.

Function Types

There are 4 function types existing:

  • Action:

There is nothing that is given back by the function and it may use parameters. This function will appear in the trigger action list.

  • Condition:

A boolean is given back. This function will appear in the trigger condition list.

  • Event:

This function will appear in the trigger event list. TODO: research, if custom Events are useable, yet?

  • Function:

Some value is given back which is not a boolean and it may use parameters. This function will appear in the trigger function list depending on which data type it returns (e.g. integer, unit, location, point, text).


If something is set to be returned, your code needs to have a return action for every possible case.

Grammatical Text

This text will be displayed in the editor, if the function is used in the Galaxy Editor. Parameter names are only shown, if they have no default value.

TODO: example picture

Hint Text

The hint text of this function which should contain a description what this function does. It is displayed when the function is selected by user.

Custom Script Code

You can write Galaxy Code here directly. TODO: which code is executed?

How to create a Trigger Function

Right click inside your left lower window (tree) and chose "new" or hit the corresponding button on top of the trigger module's main window.