ClassesClasses | | 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).

assign_atassign_atAssignAtAssignAt (Operator)

Name

assign_atassign_atAssignAtAssignAt — Assignment of one or several values to one or several tuple elements.

Signature

assign_at( : : Index, Value : Result)

Herror assign_at(const Hlong Index, const Hlong Value, double* Result)

Herror T_assign_at(const Htuple Index, const Htuple Value, Htuple* Result)

void AssignAt(const HTuple& Index, const HTuple& Value, HTuple* Result)

static void HOperatorSet.AssignAt(HTuple index, HTuple value, out HTuple result)

Description

assign_atassign_atAssignAtAssignAtAssignAt assigns a single value to one or several elements of a tuple, or it assigns a number of values elementwise to the specified elements of the output tuple. All other elements of the output tuple keep their values. If the passed indices are out of the current range of the output tuple, the tuple is increased and the new values are initialized to a default value.

In the full text editor an assign_atassign_atAssignAtAssignAtAssignAt operation is simply entered with the help of the assignment operator symbol := and the index access operator symbol [ ] following the output variable. The IndexIndexIndexIndexindex parameter can be any expression that evaluates to any number of positive integer values. The ValueValueValueValuevalue parameter must evaluate to exactly one value or to the same number of indices that are provided via the IndexIndexIndexIndexindex parameter, e.g.: Areas[Radius-1] := Area Areas[0,4,|Rad|-1] := 0 FileNames[0,2,4] := ['f1','f2','f3']

The operator assign_atassign_atAssignAtAssignAtAssignAt replaces and extends the modifying version of the old insertinsertInsertInsertInsert operator.

Parameters

IndexIndexIndexIndexindex (input_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices of the elements that have to be replaced by the new value(s).

Default value: 0

Suggested values: 0, 1, 2, 3, 4, 5, 6

Minimum increment: 1

ValueValueValueValuevalue (input_control)  tuple(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Value(s) that has to be assigned.

Default value: 1

ResultResultResultResultresult (output_control)  tuple(-array) HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Result tuple containing the assigned values.

Result

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

Alternatives

assignassignAssignAssignAssign, tuple_replacetuple_replaceTupleReplaceTupleReplaceTupleReplace

Module

Foundation


ClassesClasses | | Operators