Specify what happens when an event occurs by linking a codeblock.

A codeblock is a logical grouping of one or more dBL statements, or a dBL expression. Like a function pointer, it is a means of executing statements, and is particularly useful when used with an object’s event property.

A codeblock is an alternative to a function pointer, but there are differences. For example, unlike the function pointer, codeblocks are literal statements that you assign to the event property. A codeblock is a data type that contains dBL code. And like other data types, you can assign a codeblock to a memory variable or pass it as a parameter.

Dialog box options

 

Parameters

Enter parameters.

Type

The codeblock can be one of two types. Choose either:

Command. Can contain one or more dBL statements

Expression. Can contain only dBL expressions

Commands or Expression

Type the code statements or expression here.

How to get there: In the Inspector, click the Type button beside an event. Choose Codeblock. Then click the wrench tool.