HALCON Reference Manual 10.0.2
Table of Contents / Control ClassesClassesClasses | | | 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).

assignassignassignAssignAssign (Operator)

Name

assignassignassignAssignAssign — Assign a new value to a control variable.

Signature

assign( : : Input : Result)

Herror assign(double Input, double* Result)

Herror T_assign(const Htuple Input, Htuple* Result)

Herror assign(const HTuple& Input, double* Result)

Herror assign(const HTuple& Input, HTuple* Result)

void HOperatorSetX.Assign(
[in] VARIANT Input, [out] VARIANT* Result)

static void HOperatorSet.Assign(HTuple input, out HTuple result)

Description

assignassignassignAssignAssign assigns a new value to a variable.

In the full text editor an assignment is simply entered with the help of the assignment operator sign :=, e.g.:

  u := sin(x) + cos(y)

This is equivalent to the C syntax assignment:

  u = sin(x) + cos(y);

If the operator window is used for entering an assignment, assign must be entered into the operator combo box as an operator name. This opens the parameter area, where the parameter InputInputInputInputinput represents the expression that has to be evaluated to one value and assigned to the variable, i.e., this is the right side of the assignment. The parameter ResultResultResultResultresult gets the name of the variable, i.e., this is the left side of assignment.

Parameters

InputInputInputInputinput (input_control)  real(-array) HTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

New value.

Default value: 1

ResultResultResultResultresult (output_control)  real(-array) HTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Variable that has to be changed.

Example (HDevelop)

Tuple1 := [1,0,3,4,5,6,7,8,9]
Val := sin(1.2) + cos(1.2)
Tuple2 := []

Result

If the expression is correct assignassignassignAssignAssign returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Alternatives

insertinsertinsertInsertInsert

Module

Foundation


Table of Contents / Control ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH