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).
If dev_error_var should be used for exported Code (C++), please note the different handling of return values in C++.
|
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 | |
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
dev_error_var always returns 2 (H_MSG_TRUE)
dev_error_var is local and processed completely exclusively without parallelization.
dev_set_check, if, ifelse, assign
Foundation