Customizing Generated Code

The generators provided with DC provide numerous locations in the generated code where you can insert your own custom code. Note that if you customize only in the locations provided, your changes are retained when the code for a component is regenerated. If you customize anywhere else, your changes are lost after regeneration.

Locations for customization are indicated by pairs of special comments in the code. The first comment is of the form

%% Begin User Code: Name

where Name is any name to uniquely identify this specific location within a given program.

This line can also start with a continuation character:

 \%% Begin User Code: Name

The second comment is of the form

%% End User Code: Name

This line can also start with a continuation character:

 \%% End User Code: Name

Sometimes, the generators provide a default version of a code customization. In this case, one more comment immediately follows the Begin User Code comment:

%% DEFAULT CODE SEGMENT - Delete this line if you customize this segment.

As the comments indicate, if you want to add customizations here, you should remove the DEFAULT CODE SEGMENT comment line. Otherwise, the default code is reinserted when the code is regenerated.