Skip to content

tuple_ordsTupleOrdsTupleOrdstuple_ordstuple_ords🔗

説明🔗

tuple_ordsTupleOrdsTupleOrdstuple_ordstuple_ords — 文字の tuple を対応する ASCII コードの tuple へ変換する。

書式🔗

tuple_ords( string T, out integer Ords )void TupleOrds( const HTuple& T, HTuple* Ords )static void HOperatorSet.TupleOrds( HTuple t, out HTuple ords )def tuple_ords( t: MaybeSequence[Union[str, int]] ) -> Sequence[int]

def tuple_ords_s( t: MaybeSequence[Union[str, int]] ) -> intHerror tuple_ords( const char* T, Hlong* Ords )

Herror T_tuple_ords( const Htuple T, Htuple* Ords )

HTuple HTuple::TupleOrds( ) const

HTuple HTuple.TupleOrds( )

説明🔗

tuple_ordsTupleOrds は文字と整数を含む入力 tuple Ttt を整数のtupleへ変換します。 HALCONライブラリで使用されるエンコーディングがUTF-8 (set_system('filename_encoding', 'utf8') 参照) であり、文字列オペレータがコードポイント(set_system('tuple_string_operator_mode', 'codepoint') 参照) で動作するように設定されている場合(両方ともデフォルト)、オペレータは入力文字列へ適切な Unicode 文字コードを返します。 HALCONライブラリーのエンコードが 'locale'"locale" に設定されているか、文字列オペレータが 'byte'"byte" の場合、 オペレータは入力文字列のすべてのバイトに対してANSIコードを返します。 このモードでは、 ASCII 以外の文字を含む文字列の現在使用されているコードページによって結果が異なる場合があります。 種々のモデルと更なるエンコーディングの問題の詳細記述については、 Tuple / String Operations も参照下さい。

個々の文字列の文字コードは、文字列内と tuple 内の順序に従って出力に書き込まれます。 整数値は出力タプルの適切な位置に単純にコピーされます。 この演算子は、write_serialWriteSerial で出力を準備するために使用できます。 特に、整数値 0 を Ttt に挿入することにより、値0のバイトを書き込むことができます。

入力tupleが空の場合、この関数は空のtupleを返します。

HDevelopインライン演算🔗

HDevelopは tuple_ordsTupleOrds の代わりとなるインライン演算を備えており、以下の構文形式で使 用することができます::

Ords := ords(T)

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

Ttt (input_control) string(-array) → (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)MaybeSequence[Union[str, int]]Htuple (char* / Hlong)

文字列の入力 tuple

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

入力文字列の Unicode 文字コードまたは ANSI コードを含む出力 tuple

例🔗

(HDevelop)


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

他のオペレーターとの組み合わせ🔗

組み合わせ

他の選択候補

tuple_ordTupleOrd

関連項目

tuple_chrTupleChr, tuple_chrtTupleChrt, write_serialWriteSerial

モジュール🔗

Foundation