Tinderbox v9 Icon

Defining a function

Important note: all examples follow aTbRef naming conventions.

Defining functions

Functions are defined by the function statement:

function name(arguments){actions}

The basic syntax is comprises four parts:

A function is essentially an encapsulated set of action(s) which may take inputs—arguments—similar to the way some action code operators take input arguments. The terms 'argument', 'input' and 'argument' may be used interchangeably, as the implied meaning is the same.

Storage of function code is discussed here.

A function can be called from anywhere, as explained here.

Examples of function syntax are given here.

Can a function code contain another complete function?

Next: Function arguments