tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequence (Operator)

Name

tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequence — Generate a tuple with a sequence of equidistant values.

Signature

tuple_gen_sequence( : : Start, End, Step : Sequence)

Herror tuple_gen_sequence(const Hlong Start, const Hlong End, const Hlong Step, Hlong* Sequence)

Herror T_tuple_gen_sequence(const Htuple Start, const Htuple End, const Htuple Step, Htuple* Sequence)

void TupleGenSequence(const HTuple& Start, const HTuple& End, const HTuple& Step, HTuple* Sequence)

static HTuple HTuple::TupleGenSequence(const HTuple& Start, const HTuple& End, const HTuple& Step)

static void HOperatorSet.TupleGenSequence(HTuple start, HTuple end, HTuple step, out HTuple sequence)

static HTuple HTuple.TupleGenSequence(HTuple start, HTuple end, HTuple step)

Description

tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequenceTupleGenSequence generates a new tuple SequenceSequenceSequenceSequencesequence with a sequence of equidistant values:

[Start, Start + Step, Start + 2*Step, ... End]

StepStepStepStepstep must not be zero and the sign of (EndEndEndEndend - StartStartStartStartstart) must be equal to the sign of StepStepStepStepstep. The last entry of SequenceSequenceSequenceSequencesequence may actually be less than EndEndEndEndend, if (EndEndEndEndend - StartStartStartStartstart) is not divisible by StepStepStepStepstep without remainder.

Exception: Empty input tuples

If any of the input tuples is empty, an exception is raised.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequenceTupleGenSequence, which can be used in an expression in the following syntax:

Sequence := [Start:Step:End]

An alternative syntax is Sequence := [Start:End], where StepStepStepStepstep defaults to 1.

Execution Information

Parameters

StartStartStartStartstart (input_control)  number HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Start value of the tuple.

EndEndEndEndend (input_control)  number HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Maximum value for the last entry.

StepStepStepStepstep (input_control)  number HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Increment value.

SequenceSequenceSequenceSequencesequence (output_control)  number(-array) HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

The resulting sequence.

Alternatives

tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelect, tuple_selecttuple_selectTupleSelectTupleSelectTupleSelect, tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNTupleStrFirstN, tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNTupleStrLastN, tuple_concattuple_concatTupleConcatTupleConcatTupleConcat, tuple_inserttuple_insertTupleInsertTupleInsertTupleInsert, tuple_replacetuple_replaceTupleReplaceTupleReplaceTupleReplace, tuple_gen_consttuple_gen_constTupleGenConstTupleGenConstTupleGenConst

See also

tuple_randtuple_randTupleRandTupleRandTupleRand

Module

Foundation