dev_error_var ( : : ErrorVar, Mode : )

Define or undefine an error variable.

dev_error_var defines an error variable, i.e., a variable which contains the status of the last call of an operator. ErrorVar will be H_MSG_TRUE (2) if no error had occured. The parameter Mode specifies if the error variable should be used (1) or not (0). If an error variable is active it will be updated each an operator excetion is finished. Thus a value is only valid until the next call of an operator. The value can be saved by assigning it to another variable (see example) or by calling dev_error_var(ErrorVar,0).


Attention

If dev_error_var should be used for exported Code (C++), please note the different handling of return values in C++.


Parameters

ErrorVar (input_control)
integer(-array) -> integer
Name of the variable which shall contain the error status.

Mode (input_control)
integer -> integer
Switch the error variable on or off.
Default value: 1
List of values: 0, 1


Example
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
dev_error_var (Error, 1)
dev_set_check ('~give_error')
FileName := 'wrong_name'
read_image (Image, FileName)
ReadError := Error
if (ReadError # H_MSG_TRUE)
  write_string (WindowHandle, 'wrong file name: '+FileName)
endif

Result

dev_error_var always returns 2 (H_MSG_TRUE)


Parallelization Information

dev_error_var is local and processed completely exclusively without parallelization.


Possible Predecessors

dev_set_check


Possible Successors

dev_set_check, if, ifelse, assign


See also

set_check


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH