Elmomc SimplIQ Software Manual Manual de usuario Pagina 50

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 226
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 49
SimplIQ Software Manual 4BThe SimplIQ User Programming Language
MAN-SIMSW (Ver. 1.4)
5-21
Global variables can still be used and monitored by the user with external terminals,
such as the Composer Smart Terminal.
5.7.11 Try-Catch
A try-catch block is used to react to an expected fault.
Syntax:
try
statement, …, statement,
catch
statement, …, statement
end
The
SimplIQ drive stores the status (stack and base pointers) and executes the statements
between the try and the catch. If successful, nothing else happens. If an error occurs, the
status is restored and the
SimplIQ drive executes the catch block. A failure in the catch block
is treated as an unexpected failure.
The
SimplIQ drive cannot undo statements that were already executed in the try block before
a failure.
Limitations for using a try-catch block include:
It is illegal to use goto and return statements within a try-catch block.
A control block within a try-catch block must be closed. For example:
int a;
try
if (a==1)
catch
end
This example is illegal, because the if control block is not closed inside the try block.
A try-catch block within a control block must be closed. For example:
int a;
if (a==1)
try
else
catch
end
end
This example is illegal because the try-catch block is not closed within the if block.
Vista de pagina 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 225 226

Comentarios a estos manuales

Sin comentarios