ExecuteFormFieldScriptJSON

フォーム、JavaScriptの安全性

説明

フィールドの validate、calculate、format、keystroke アクションを実行し、結果とイベント状態を JSON で返します。DLL と ActiveX インターフェース向けに ExecuteFormFieldScriptEvent の機能を提供します

構文

Delphi

Function TPDFlib.ExecuteFormFieldScriptJSON(Index, Action: Integer; Const Value, Change: WideString; SelStart, SelEnd, Flags: Integer): WideString;

ActiveX

Function PDFlib::ExecuteFormFieldScriptJSON(Index As Long, Action As Long, InputValue As String, Change As String, SelStart As Long, SelEnd As Long, Flags As Long) As String

タイプライブラリ バージョン 3.5 以降で IPDFlibrary4 から利用可能

DLL

const wchar_t* DLExecuteFormFieldScriptJSON(int InstanceID, int Index, int Action, const wchar_t* Value, const wchar_t* Change, int SelStart, int SelEnd, int Flags);
const char* DLExecuteFormFieldScriptJSONA(int InstanceID, int Index, int Action, const char* Value, const char* Change, int SelStart, int SelEnd, int Flags);

パラメータ

Index1 起算のフィールドインデックス
Action0 validate、1 calculate、2 format、3 keystroke
Value, Change初期の event.value と event.change
SelStart, SelEnd変更で置き換えられる選択範囲
Flags1 willCommit、2 fieldFull、4 keyDown、8 modifier、16 shift の合計

戻り値

result(ExecuteFormFieldScriptEvent の戻り値)、value、change、rc、selStart、selEnd を含む JSON オブジェクト。無効な Action は LastErrorCode 708 で {"result":0} を返します

ソースフィールドはターゲットフィールドです。DLL の文字列はインスタンスのリターンバッファに属するため、次の呼び出しの前にコピーしてください

関連項目

ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics