Inserting and Removing Error Handlers
CodeSMART can automatically insert and remove error handling code into your projects.
In order to obtain the best results with the CodeSMART error handling system you must
be familiar with the error handling schemes, error handling assignments
and error handling scheme modifiers. Please jump to the Error handling schemes and assignments and Error
handling scheme modifiers pages for details on these issues.
To insert error handlers:
-
Open the project you want to insert the error handling code in and (if
applicable, depending on the operation's scope) select a component or a single
procedure.
-
Click Insert Error Handling Code on the Code Edit Tools toolbar
in order to display the Error Handlers Inserter dialog box (quick
toolbar
and menu references are available).
-
Select the operation scope.
Depending on the current position in code and the active code or
designer window, only valid options are listed.
-
If at step 2 you have selected the current procedure or component CodeSMART
tries to select the corresponding error handling scheme according to your selection
and the eventual error handling scheme modifiers and assignments. If you want
to insert a different scheme than the one determined by CodeSMART then you should
select it in the Current scheme combo box. The Preview will be
updated in order to display how the code would look like in a hypothetic procedure.
If you select a wider scope, like the project or the entire group you will not
be allowed to specify a particular scheme. CodeSMART will cycle every component and
every method inside that project or group and will determine the scheme to be
inserted based on existing modifiers and the defined assignments.
-
Press Begin to perform the insertion. Depending on the situation, a progress
bar may appear to reflect the operation progress.
Notes
-
The procedures that do not have modifier markers or special error handling schemes
assignments inherit the component's error scheme. Also, components that do not
have modifier markers or assignments use the default assignment.
-
The two inserted error handling code blocks are delimited by CodeSMART with
special comments. Don't remove any of these comments if you want CodeSMART to
be able to automatically remove the error handling code it inserted.
-
If you want to prevent a component or procedure from being affected by the error
handlers insertion then you should use the Skip modifier for that component
or procedure.
To remove error handlers:
-
Open the project you want to remove the error handling code from and
(if applicable, depending on the operation's scope) select a component or a
single procedure.
-
Click the Remove Error Handling Code button on the Code Edit Tools
toolbar in order to display the Error Handlers Remover dialog.
-
Specify the operation scope.
Depending on the current position in code and the active code or
designer window, only valid options are listed.
-
Press Begin in order to start the operation.
Notes
-
If a scheme contains line numbers then they will also be removed from the code.
-
If a component or procedure has an error handling scheme modifier marker specifying
a scheme that is no longer valid then you should delete the modifier before
proceeding with the error handling code removal.
-
To remove CodeSMART 3.x error handling code you should use the Remove old
style (v3.x) error handlers tool whose dialog box is displayed by selecting
the same entry in the CodeSMART main menu.
See also
Back To Top
|