Error handling commands – CUE Design Director Script Language User Manual

Page 17

Advertising
background image

Reference Manual Design Director Script Language

www.cuesystem.com

Page 17 of 94

2.4.4.

Error Handling Commands

The commands are divided into two following group

• declaration handling commands

• resume error handling commands.

Declaration handling commands are not any different from the executive and flow control commands,
from the place where they can be used. They can be used anywhere where are other commands.

For the macro it is always used the last called declaration handling command – the block structure of the
program does not have any influence on declaration handling command (if before the cycle command
OnErrorCallException command for the error handling is used and in the cycle command
OnErrorResumeNext command is called then even after the cycle will end, the declaration
OnErrorResumeNext is used when an error occurs).

Resume error handling commands as well the declaration handling commands do not differ from the
place of use from the executive and flow control commands.

While declaration handling commands are similar to executive commands – they change the system
status (i.e. change the way of error handling), the resume error handling commands are closer to flow
control commands. In the macro that handles an error ( or macro that was called by error handling macro
– it can do with an arbitrary call level) resume from error command makes a change of place of the
program execution - returns through all the macros that they have called among themselves during the
process of error handling to the place where the error has occurred (even somewhere according to used
error handling resume command)

Declaration error handling command – on error resume - OnErrorResumeNext

Designed syntax:

OnErrorResumeNext

After this command is called and if an error occurs, the command, where the mistake has occurred is
skipped to Err object then the error code is set and it is continued with the next command.

In case the position where the error has occurred is a condition of the structured command (i.e.
If,Do..Loop), then it is resumed with the next command after the entire structure.

That means for If command it is continued after particular EndIf, in case of Do..Loop cycle it is continued
after Loop.

Advertising