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_error_vardev_error_varDevErrorVardev_error_varDevErrorVarDevErrorVar (Operator)

Name

dev_error_vardev_error_varDevErrorVardev_error_varDevErrorVarDevErrorVar — Define or undefine an error variable.

Signature

dev_error_var( : : ErrorVar, Mode : )

Herror dev_error_var(const Hlong ErrorVar, const Hlong Mode)

Herror T_dev_error_var(const Htuple ErrorVar, const Htuple Mode)

Herror dev_error_var(const HTuple& ErrorVar, const HTuple& Mode)

void DevErrorVar(const HTuple& ErrorVar, const HTuple& Mode)

void HOperatorSetX.DevErrorVar(
[in] VARIANT ErrorVar, [in] VARIANT Mode)

static void HOperatorSet.DevErrorVar(HTuple errorVar, HTuple mode)

Description

dev_error_vardev_error_varDevErrorVardev_error_varDevErrorVarDevErrorVar defines an error variable, i.e., a variable which contains the result state of the last operator call. ErrorVarErrorVarErrorVarErrorVarErrorVarerrorVar will be 2 (H_MSG_TRUE) if no error had occurred. The parameter ModeModeModeModeModemode specifies whether the error variable should be used (1) or not (0). If an error variable is active it will be updated each time an operator execution 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)dev_error_var(ErrorVar,0)DevErrorVar(ErrorVar,0)dev_error_var(ErrorVar,0)DevErrorVar(ErrorVar,0)DevErrorVar(ErrorVar,0).

Parameters

ErrorVarErrorVarErrorVarErrorVarErrorVarerrorVar (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Name of the variable which shall contain the error status.

Default value: 'ErrorVar' "ErrorVar" "ErrorVar" "ErrorVar" "ErrorVar" "ErrorVar"

ModeModeModeModeModemode (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Switch the error variable on or off.

Default value: 1

List of values: 0, 1

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)
endif

Result

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

Possible Predecessors

dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck

Possible Successors

dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck, ififIfifIfIf, elseifelseifElseifelseifElseifElseif, elseelseElseelseElseElse, assignassignAssignassignAssignAssign

See also

dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck, set_checkset_checkSetCheckset_checkSetCheckSetCheck

Module

Foundation


ClassesClassesClassesClasses | | | | Operators