ClassesClasses | | Operators

tuple_ordstuple_ordsTupleOrdsTupleOrds (Operator)

Name

tuple_ordstuple_ordsTupleOrdsTupleOrds — Convert a tuple of strings into a tuple of integer numbers.

Signature

tuple_ords( : : T : Ords)

Herror tuple_ords(const char* T, Hlong* Ords)

Herror T_tuple_ords(const Htuple T, Htuple* Ords)

void TupleOrds(const HTuple& T, HTuple* Ords)

HTuple HTuple::TupleOrds() const

static void HOperatorSet.TupleOrds(HTuple t, out HTuple ords)

HTuple HTuple.TupleOrds()

Description

tuple_ordstuple_ordsTupleOrdsTupleOrdsTupleOrds converts the input tuple TTTTt, which may only contain strings and integer numbers, into a tuple of integer numbers that represent the ASCII code of the characters of the strings (as long as the characters are part of the ASCII standard, for other characters please note the influence of the used character encoding table, as is touched in Tuple / String Operations). The characters of the individual strings are output according to their order within the string and within the tuple. Integer numbers are simply copied to an appropriate position in the output string. This operator can be used to prepare outputs with write_serialwrite_serialWriteSerialWriteSerialWriteSerial. In particular, a byte with value 0 can be written by inserting the integer number 0 into TTTTt.

Exception: Empty input tuple

If the input tuple is empty, the operator returns an empty tuple.

HDevelop In-line Operation

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

Ords := ords(T)

Execution Information

Parameters

TTTTt (input_control)  string(-array) HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Input tuple with strings.

OrdsOrdsOrdsOrdsords (output_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Output tuple with integer numbers.

Example (HDevelop)

tuple_ords (['String 1', 0, 'String 2', 0], Data)
write_serial (SerialHandle, Data)

Alternatives

tuple_ordtuple_ordTupleOrdTupleOrdTupleOrd

See also

tuple_chrtuple_chrTupleChrTupleChrTupleChr, tuple_chrttuple_chrtTupleChrtTupleChrtTupleChrt, write_serialwrite_serialWriteSerialWriteSerialWriteSerial

Module

Foundation


ClassesClasses | | Operators