Skip to content

tuple_ordTupleOrdTupleOrdtuple_ordtuple_ord🔗

Short description🔗

tuple_ordTupleOrdTupleOrdtuple_ordtuple_ord — Convert a tuple of strings of length 1 into a tuple of integer numbers.

Signature🔗

tuple_ord( string T, out integer Ord )void TupleOrd( const HTuple& T, HTuple* Ord )static void HOperatorSet.TupleOrd( HTuple t, out HTuple ord )def tuple_ord( t: MaybeSequence[str] ) -> Sequence[int]

def tuple_ord_s( t: MaybeSequence[str] ) -> intHerror tuple_ord( const char* T, Hlong* Ord )

Herror T_tuple_ord( const Htuple T, Htuple* Ord )

HTuple HTuple::TupleOrd( ) const

HTuple HTuple.TupleOrd( )

Description🔗

tuple_ordTupleOrd converts the input tuple Ttt, which may only contain strings of length 1, into a tuple of integer numbers. When the encoding used in the HALCON library is UTF-8 (see set_system('filename_encoding', 'utf8')) and the string operators are set to work by code points (see set_system('tuple_string_operator_mode', 'codepoint')), which is the default for both, the operator accepts the UTF-8 representation of a Unicode character (code point) and returns the appropriate Unicode character code. When the HALCON library encoding is set to 'locale'"locale" or the string operator mode is 'byte'"byte", the operator accepts only a single byte for each input string. In that case the operator tuple_ordTupleOrd returns the ANSI code of the input byte as integer number between 0 and 256. See also Tuple / String Operations for a more detailed description of the different modes and further encoding issues.

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

HDevelop In-line Operation🔗

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

Ord := ord(T)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Ttt (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Input tuple with strings of length 1.

Ordordord (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Output tuple with Unicode character codes or ANSI codes of the characters passed in the input tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_ordsTupleOrds

See also

tuple_chrTupleChr, tuple_chrtTupleChrt

Module🔗

Foundation