Please enable JavaScript to view this site.

ESL Documentation

Action Statement

Reference an action routine.

action ROUTINE_NAME

 

ROUTINE_NAME

The identifier for an action routine.

Description

When you call an action routine, ESL performs the action statements specified in the routine, just as if the actions had been specified in line.

All ESL variables, expressions, and built-in functions are evaluated when an action routine is executed, not when it is defined. Thus, an expression in the routine that has a certain value the first time the routine is called might have a different value the next time the routine is called. This would occur if the value of the variable used as an operand in the expression is changed between executions of the action routine.

You can reference an action routine inside the definition of another action routine. Action routines may also call themselves recursively. However, if you do this, be sure to set a condition that ends the recursion so that it does not create an infinite loop.

Examples

 

response to start

 action Startup

 

response to keycaps

 action parameter         # The parameter contains the name

                         # of an action routine.

 

# The following example shows how actions can be called

# by referencing string identifiers of the action:

...

push button Goto2_PB in DialogBox1_DB

...

parameter is "DialogBox2"

...

 

push button Goto2_PB in DialogBox2_DB

...

parameter is "DialogBox3"

 

class PB_CL is

 Goto2_PB in DialogBox1

 Goto3_PB in DialogBox2

 

string variable ActionName_SV

 

action SetupDialogBox2 is

 make DialogBox2 permanent

 

action SetupDialogBox3 is

 make DialogBox3 permanent

 

response to CB_CL

 copy "Setup" (parameter of object) to ActionName_SV

 action ActionName_SV

See Also

action is Action Routine Definition