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.

assign_atassign_atAssignAtAssignAtassign_at (Operator)

Name

assign_atassign_atAssignAtAssignAtassign_at — 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)

def assign_at(index: MaybeSequence[int], value: MaybeSequence[Union[int, float, str]]) -> Sequence[Union[int, float, str]]

def assign_at_s(index: MaybeSequence[int], value: MaybeSequence[Union[int, float, str]]) -> Union[int, float, str]

Description

assign_atassign_atAssignAtAssignAtAssignAtassign_at 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_atAssignAtAssignAtAssignAtassign_at operation is simply entered with the help of the assignment operator symbol := and the index access operator symbol [ ] following the output variable. The IndexIndexIndexIndexindexindex parameter can be any expression that evaluates to any number of positive integer values. The ValueValueValueValuevaluevalue parameter must evaluate to exactly one value or to the same number of indices that are provided via the IndexIndexIndexIndexindexindex parameter, e.g.: Areas[Radius-1] := Area Areas[0,4,|Rad|-1] := 0 FileNames[0,2,4] := ['f1','f2','f3']

The operator assign_atassign_atAssignAtAssignAtAssignAtassign_at replaces and extends the modifying version of the old insertinsertInsertInsertInsertinsert operator.

Parameters

IndexIndexIndexIndexindexindex (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (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

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

Value(s) that has to be assigned.

Default value: 1

ResultResultResultResultresultresult (output_control)  tuple(-array) HTupleSequence[Union[int, float, str]]HTupleHtuple (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_atAssignAtAssignAtAssignAtassign_at returns 2 (H_MSG_TRUE). Otherwise, an exception is raised and an error code returned.

Alternatives

assignassignAssignAssignAssignassign, tuple_replacetuple_replaceTupleReplaceTupleReplaceTupleReplacetuple_replace

Module

Foundation