tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const (算子)

名称

tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const — 生成一个特定长度的元组并初始化其元素。

签名

tuple_gen_const( : : Length, Const : Newtuple)

Herror tuple_gen_const(const Hlong Length, const Hlong Const, Hlong* Newtuple)

Herror T_tuple_gen_const(const Htuple Length, const Htuple Const, Htuple* Newtuple)

void TupleGenConst(const HTuple& Length, const HTuple& Const, HTuple* Newtuple)

static HTuple HTuple::TupleGenConst(const HTuple& Length, const HTuple& Const)

static void HOperatorSet.TupleGenConst(HTuple length, HTuple constVal, out HTuple newtuple)

static HTuple HTuple.TupleGenConst(HTuple length, HTuple constVal)

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]

描述

tuple_gen_consttuple_gen_constTupleGenConstTupleGenConstTupleGenConsttuple_gen_const generates a new tuple in NewtupleNewtupleNewtupleNewtuplenewtuplenewtuple. The input parameter LengthLengthLengthLengthlengthlength determines the number of elements for the new tuple. Thus, LengthLengthLengthLengthlengthlength may only consist of a single number. If LengthLengthLengthLengthlengthlength 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 ConstConstConstConstconstValconst that may only consist of a single element. All elements in NewtupleNewtupleNewtupleNewtuplenewtuplenewtuple have got the same data type and value as the single element in ConstConstConstConstconstValconst

例外:空输入元组

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

HDevelop 内联操作

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

Newtuple := gen_tuple_const(Length, Const)

执行信息

参数

LengthLengthLengthLengthlengthlength (输入控制)  number HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Length of tuple to generate.

ConstConstConstConstconstValconst (输入控制)  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.

NewtupleNewtupleNewtupleNewtuplenewtuplenewtuple (输出控制)  tuple(-array) HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

New Tuple.

替代

tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select, tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select, tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNTupleStrFirstNtuple_str_first_n, tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNTupleStrLastNtuple_str_last_n, tuple_concattuple_concatTupleConcatTupleConcatTupleConcattuple_concat, tuple_inserttuple_insertTupleInsertTupleInsertTupleInserttuple_insert, tuple_replacetuple_replaceTupleReplaceTupleReplaceTupleReplacetuple_replace, tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence

另见

tuple_randtuple_randTupleRandTupleRandTupleRandtuple_rand

模块

基础