/* サンプル1 - 基本的な処理の雛形 */ myself = 0 ///< 自分のゲート番号 (ゲート0: フロントエンドからの要求) target = 1 ///< 接続先ゲート番号 (ゲート1: 辞書プロセスへの処理依頼) Gate = new ActiveXObject("SKKGate") Shell = new ActiveXObject("WScript.Shell") // メイン for (;;) { // 待機 id = Gate.Sync(myself, 1) // 終了 (停止要求 -1 / 二重起動 -2) if (id < 0) { if (id == -2) { Shell.Popup("停止します") Gate.Sync(-1, myself) } break } index = Gate.Get() cand = Gate.Get(1) attr = Gate.Get(2) switch (id) { // 変換 case 0: result = Gate.Search(index, attr, target).split(/\3|$/) for (i in result) Gate.Put(result[i]) break // 補完 case 1: result = Gate.Abbrev(index, attr, target).split(/\3|$/) for (i in result) Gate.Put(result[i]) break // 確定 case 2: Gate.Update(index, cand, attr, target) break // 削除 case 3: Gate.Delete(index, cand, attr, target) break // // 予約 // default: // Gate.Exec(target) // break } }