Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

assignassignAssignAssignassign (算子名称)

名称

assignassignAssignAssignassign — Assign a new value to a variable.

参数签名

assign( : : Input : Result)

Herror assign(double Input, double* Result)

Herror T_assign(const Htuple Input, Htuple* Result)

void Assign(const HTuple& Input, HTuple* Result)

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

def assign(input: MaybeSequence[Union[int, float, str]]) -> Sequence[Union[int, float, str]]

def assign_s(input: MaybeSequence[Union[int, float, str]]) -> Union[int, float, str]

描述

assignassignAssignAssignAssignassign assigns a new value to a variable.

In the full text editor, an assignment is simply entered with the help of the assignment operator :=, 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 InputInputInputInputinputinput 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 ResultResultResultResultresultresult gets the name of the variable, i.e., this is the left side of assignment.

注意

In addition to the parameter type control, which is indicated in the parameter description, assignassignAssignAssignAssignassign also supports iconic variables and vector variables. For an assignment, the parameter types of the two parameters InputInputInputInputinputinput and ResultResultResultResultresultresult must be identical. For the assignment of iconic objects, the operator copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj is used internally.

参数表

InputInputInputInputinputinput (input_control)  real(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

New value.

Default: 1

ResultResultResultResultresultresult (output_control)  real(-array) HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Variable that has to be changed.

例程 (HDevelop)

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

结果

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

可替代算子

insertinsertInsertInsertInsertinsert

模块

Foundation