tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const (Operator)
Name
tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const
— Generate a tuple of a specific length and initialize its elements.
Signature
def tuple_gen_const(length: Union[float, int], const: HTupleElementType) -> Sequence[Union[float, int, str]]
def tuple_gen_const_s(length: Union[float, int], const: HTupleElementType) -> Union[float, int, str]
Description
tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const
generates a new tuple in NewtupleNewtupleNewtuplenewtuplenewtuple
.
The input parameter LengthLengthLengthlengthlength
determines the number of elements
for the new tuple. Thus, LengthLengthLengthlengthlength
may only consist of a single number.
If LengthLengthLengthlengthlength
contains a floating point number, this may only
represent an integer value (without fraction).
The data type and value of each element of the new generated tuple is
determined by the input parameter ConstConstConstconstValconst
that may only
consist of a single element. All elements in NewtupleNewtupleNewtuplenewtuplenewtuple
have got the same data type and value as the single element in
ConstConstConstconstValconst
.
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_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const
,
which can be used in an expression in the following syntax:
Newtuple := gen_tuple_const(Length, Const)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
LengthLengthLengthlengthlength
(input_control) number →
HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Length of tuple to generate.
ConstConstConstconstValconst
(input_control) tuple →
HTupleHTupleElementTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
Constant for initializing the tuple elements.
NewtupleNewtupleNewtuplenewtuplenewtuple
(output_control) tuple(-array) →
HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
New Tuple.
Alternatives
tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select
,
tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
,
tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNtuple_str_first_n
,
tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNtuple_str_last_n
,
tuple_concattuple_concatTupleConcatTupleConcattuple_concat
,
tuple_inserttuple_insertTupleInsertTupleInserttuple_insert
,
tuple_replacetuple_replaceTupleReplaceTupleReplacetuple_replace
,
tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence
See also
tuple_randtuple_randTupleRandTupleRandtuple_rand
Module
Foundation