<< Prev        Next >>

ID : 610

Example Error Processing

Error processing designation (On Error ...) is valid within the procedure.

Sub Main
  On Error GoTo CCC  'Execute first
  Call BBB           'Execute second
  ...                'Execute seventh
  Exit Sub           'Execute eighth
CCC:
  'Error processing        'Execute fifth
  Resume Next        'Execute sixth
End Sub

Sub BBB
  ...                'Execute third
  i[10] = "DENSO"    'Execute fourth (LV1 error occurrence)
  ...                'No execution
End Sub

In the above example, error processing is configured in the caller procedure (Main) but not in the call target (BBB).

If an error level 1 occurs in the call target, the error is generated and the system returns to the caller procedure (Main) because no error processing is configured in the procedure BBB. In the caller procedure, it jumps to the label CCC since error processing is configured in "GoTo CCC."

ID : 610

<< Prev        Next >>