ClassesClassesClassesClasses | | | | Operators

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.

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

assign_atassign_atAssignAtassign_atAssignAtAssignAt (Operator)

Name

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

Herror assign_at(const HTuple& Index, const HTuple& Value, double* Result)

Herror assign_at(const HTuple& Index, const HTuple& Value, HTuple* Result)

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

void HOperatorSetX.AssignAt(
[in] VARIANT Index, [in] VARIANT Value, [out] VARIANT* Result)

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

Description

assign_atassign_atAssignAtassign_atAssignAtAssignAt 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_atAssignAtassign_atAssignAtAssignAt 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_atAssignAtassign_atAssignAtAssignAt replaces and extends the modifying version of the old insertinsertInsertinsertInsertInsert operator.

Parameters

IndexIndexIndexIndexIndexindex (input_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (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) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Value(s) that has to be assigned.

Default value: 1

ResultResultResultResultResultresult (output_control)  tuple(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Result tuple containing the assigned values.

Result

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

Alternatives

assignassignAssignassignAssignAssign, tuple_replacetuple_replaceTupleReplacetuple_replaceTupleReplaceTupleReplace

Module

Foundation


ClassesClassesClassesClasses | | | | Operators