json_load

JSON 文字列をパースしてハンドル取得

json_load "text"

(プラグイン / モジュール : iron_json.hsp)

解説

JSON テキストをパースして整数ハンドルを返します。
失敗時は -1。

例:
  hid = json_load("{\"name\":\"Alice\",\"age\":30}")
  if hid >= 0 {
    mes json_str(hid, "name")
    json_release hid
  }

関連項目

json_releaseハンドルを解放(iron_json.hsp)
json_strJSON 文字列値の取得(iron_json.hsp)
json_intJSON 整数値の取得(iron_json.hsp)

サンプル逆引き (3)

sample_cam_ai.hsp
sample_json.hsp
sample_weather.hsp

情報

プラグイン / モジュールiron_json.hsp
バージョン1.0
作成日2026-04-13
著作者IronHSP / iron_json
URLhttps://github.com/inovia/IronHSP
備考iron_json.hsp は hspjson.dll を HSP3 から扱いやすくするラッパです。
出力 var の sdim を内部で自動化し、defcfunc 形式で値を返すので
1 行で取得できます。

#include "iron_json.hsp"

依存: hspjson.dll を実行ファイルと同じディレクトリに配置。
タイプ拡張命令
グループiron_json
対応環境
  • その他 : Win32 / Win64
hs ファイルhsphelp\iron_json.hs