To create a new codeblock for an event,

  1. Select CodeBlock from the event’s drop-down Type list.

To create a new codeblock for a Text control,

  1. Select its text property in the Inspector.

Editing an existing code block

If you have an existing code block you want to edit (it will be in an event or the text property of a Text control), you can open the Code Block Builder dialog box in these ways:

For an event,

Select the event in the Inspector, and then select the wrench tool beside it, or

Choose Method|Edit Event, and if a code block is already associated with the event, the Code Block Builder opens (otherwise, the Source editor opens).

For a Text control, select its text property in the Inspector, and then select the wrench tool beside it.

Make your changes in the Parameters text box and in the Commands Or Expression text box.

When you click OK, dBASE Plus checks the syntax of the code block. If an error exists, dBASE Plus attempts to repair the error. If it can’t, a warning message box notifies you of the error, and the Code Block Builder stays open so you can fix the error. Focus is placed on the text box where the error occurs: Parameters or Commands Or Expression. If you don’t know how to fix the error, you can choose Cancel and dBASE Plus keeps the previous code.

If the code block is error-free, then the Code Block Builder closes. The code block is condensed back into one line and displayed in the appropriate line in the Inspector. The indentations and carriage returns are removed.