ClassesClassesClassesClasses | | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck (Operator)


dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck — Specify the error handling in HDevelop.


dev_set_check( : : Mode : )

Herror dev_set_check(const char* Mode)

Herror T_dev_set_check(const Htuple Mode)

Herror dev_set_check(const HTuple& Mode)

void DevSetCheck(const HTuple& Mode)

void HOperatorSetX.DevSetCheck([in] VARIANT Mode)

static void HOperatorSet.DevSetCheck(HTuple mode)


dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck specifies how HDevelop has to react in case of an error, i.e., if the return state of an operator is not H_MSG_TRUE (2).

If ModeModeModeModeModemode has the value 'give_error'"give_error""give_error""give_error""give_error""give_error"---which is the system default---an erroneous operator call will throw an exception, that can be caught within the HDevelop program by the catchcatchCatchcatchCatchCatch statement. However, if there is no surrounding trytryTrytryTryTry-catchcatchCatchcatchCatchCatch block in the HDevelop program and the program is executed within HDevelop, the program execution stops at the erroneous operator and an error message box is opend to display the error text. In addition, the appropriate operator call is entered into the 'Operator Window'"Operator Window""Operator Window""Operator Window""Operator Window""Operator Window", so that the user can easily edit and possibly correct the parameters of the erroneous operator call. If the procedure was called from HDevEngine and the exception is not caught within the HDevelop program, an HDevEngineException object is thrown and the procedure is left.

If ModeModeModeModeModemode is set to '~give_error'"~give_error""~give_error""~give_error""~give_error""~give_error", the error will be ignored and the program continues with the next operator. dev_set_check('~give_error')dev_set_check("~give_error")DevSetCheck("~give_error")dev_set_check("~give_error")DevSetCheck("~give_error")DevSetCheck("~give_error") is intended to be used in connection with dev_error_vardev_error_varDevErrorVardev_error_varDevErrorVarDevErrorVar, which allows to check the result state that is returned by the operator calls.


Using the code export feature of HDevelop, the code that is generated for this operator may have a different behavior than the related HALCON operator. For a detailed description of the code export of HDevelop graphics operators into the different programming languages see in the “HDevelop User's Guide” the chapter Code Export -> General Aspects of Code Generation -> Graphics Windows.


ModeModeModeModeModemode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Mode of error handling.

Default value: 'give_error' "give_error" "give_error" "give_error" "give_error" "give_error"

Example (HDevelop)

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)
* Now the program will stop with an exception
dev_set_check ('give_error')
read_image (Image, FileName)


If the values of the specified parameters are correct dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Possible Successors


See also

set_checkset_checkSetCheckset_checkSetCheckSetCheck, trytryTrytryTryTry, catchcatchCatchcatchCatchCatch, endtryendtryEndtryendtryEndtryEndtry



ClassesClassesClassesClasses | | | | Operators