Skip to content

get_dict_tupleGetDictTupleGetDictTupleget_dict_tupleT_get_dict_tuple🔗

説明🔗

get_dict_tupleGetDictTupleGetDictTupleget_dict_tupleT_get_dict_tuple — ディクショナリから、キーに関連付けされた tuple を検索する。

書式🔗

get_dict_tuple( dict DictHandle, string Key, out tuple Tuple )void GetDictTuple( const HTuple& DictHandle, const HTuple& Key, HTuple* Tuple )static void HOperatorSet.GetDictTuple( HTuple dictHandle, HTuple key, out HTuple tuple )def get_dict_tuple( dict_handle: HHandle, key: MaybeSequence[Union[str, int]] ) -> Sequence[Union[int, float, str]]

def get_dict_tuple_s( dict_handle: HHandle, key: MaybeSequence[Union[str, int]] ) -> Union[int, float, str]Herror T_get_dict_tuple( const Htuple DictHandle, const Htuple Key, Htuple* Tuple )

HTuple HDict::GetDictTuple( const HTuple& Key ) const

HTuple HDict::GetDictTuple( const HString& Key ) const

HTuple HDict::GetDictTuple( const char* Key ) const

HTuple HDict::GetDictTuple( const wchar_t* Key ) const (Windows only)

HTuple HDict.GetDictTuple( HTuple key )

HTuple HDict.GetDictTuple( string key )

説明🔗

get_dict_tupleGetDictTuple は DictHandledictHandledict_handle で表されるディクショナリから、 Keykeykey に関連付けされた tuple を検索します。 その tuple は、set_dict_tupleSetDictTuple を用いて、予め、ディクショナリに格納されている必要があります。

このオペレータは、パラメータ Tupletupletuple にデータを返します。 文字列を含むデータはこのオペレータ実行によりコピーされ、その直後から、ディクショナリは再利用ができます。

もしディクショナリに、入力として与えられた Keykeykey が存在しない場合、あるいは、 そのキーに関連付けられたデータが tuple ではない場合、get_dict_tupleGetDictTuple は失敗します。 キーが存在するかどうかおよびそのキーに関連付けられたデータについての情報は、 get_dict_paramGetDictParam を用いて確認することができます。

複数のキーの値を一度に取得できるのは、それらのキーのそれぞれについて、 ディクショナリに単一の要素を持つtupleが含まれている場合のみです。

HDevelopインライン操作🔗

HDevelopではget_dict_tupleGetDictTuple のインライン操作を提供しており、 以下の構文の式で使用できます:

  • 動的構文:

    Tuple := DictHandle.['Key']

  • 静的構文:

    Tuple := DictHandle.Key

実行情報🔗

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

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

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

パラメーター🔗

DictHandledictHandledict_handle (input_control) dict → (handle)HTuple (HHandle)HDict, HTuple (IntPtr)HHandleHtuple (handle)

ディクショナリのハンドル

要素数: DictHandle == 1

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

キーとなる文字列

Tupletupletuple (output_control) tuple(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)Sequence[Union[int, float, str]]Htuple (char* / Hlong / double)

ディクショナリから検索された tuple

例🔗

(HDevelop)


* ...
get_dict_param (Dict, 'key_exists', ['simple_string','foo','my_image'], \
                KeysPresence)
get_dict_param (Dict, 'key_data_type', ['simple_string','my_image'], \
                KeysType)
get_dict_tuple (Dict, 'simple_string', TupleString)
*
* Access multiple keys, if their tuple all have length 1
get_dict_tuple (Dict, ['key1','key2','key3'], MultipleValues)

結果🔗

オペレータ実行に成功すると、get_dict_tupleGetDictTuple は 2 (H_MSG_TRUE) を返します。 そうでない場合は、例外が発生します。 発生しうるエラー状態としては、無効なパラメータ(ハンドルやキー)、あるいは、ディクショナリに要求のキーが見つからない、 あるいは、入力として与えられたキーに関連付けられた tuple データがないことなどがあります。

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

組み合わせ

前処理の候補

set_dict_tupleSetDictTuple

後処理の候補

get_dict_tupleGetDictTuple, set_dict_tupleSetDictTuple, set_dict_tuple_atSetDictTupleAt

他の選択候補

get_dict_objectGetDictObject

関連項目

create_dictCreateDict, set_dict_tupleSetDictTuple, set_dict_objectSetDictObject, get_dict_objectGetDictObject, remove_dict_keyRemoveDictKey, get_dict_paramGetDictParam

モジュール🔗

Foundation