ExecuteFormFieldScriptJSONA
Forms, JavaScript safety
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to ExecuteFormFieldScriptJSON and string arguments are interpreted using the current SetAnsiMode code page
Runs a field validation, calculation, formatting or keystroke action and returns the result and event state as JSON. It provides ExecuteFormFieldScriptEvent to the DLL and ActiveX interfaces
Syntax
Delphi
Function DLExecuteFormFieldScriptJSONA(InstanceID, Index, Action: Integer; Value, Change: PAnsiChar; SelStart, SelEnd, Flags: Integer): PAnsiChar;
DLL
const char* DLExecuteFormFieldScriptJSONA(int InstanceID, int Index, int Action, const char* Value, const char* Change, int SelStart, int SelEnd, int Flags);
Parameters
| Index | The one-based field index |
|---|---|
| Action | 0 validate, 1 calculate, 2 format or 3 keystroke |
| Value, Change | The initial event.value and event.change |
| SelStart, SelEnd | The selection the change replaces |
| Flags | Sum of 1 willCommit, 2 fieldFull, 4 keyDown, 8 modifier and 16 shift |
Return values
A JSON object with result (the ExecuteFormFieldScriptEvent return value), value, change, rc, selStart and selEnd; an invalid Action returns {"result":0} with LastErrorCode 708
The source field is the target field. DLL strings belong to the instance return buffer and must be copied before the next call
See also
ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics