THPDFJavaScriptEvaluationResult Record
Outcome of a safe form-field JavaScript evaluation: executed and accepted flags, resulting value, operation count, error text, elapsed time, and value size
Declaration
THPDFJavaScriptEvaluationResult= record
Executed: boolean;
Accepted: boolean;
Value: AnsiString;
OperationCount: Integer;
ErrorText: AnsiString;
ElapsedMilliseconds: Cardinal;
ValueBytes: Int64;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
Executed | true when a JavaScript action attached to the field trigger actually ran in the safe interpreter |
Accepted | true when the sandbox accepted the script's result; rejected results must not be written back to the field |
Value | Field value after the run: the interpreter output when accepted, otherwise the input value that was passed in |
OperationCount | Interpreter operations consumed by the script, against the configured script budget |
ErrorText | Failure description, for example that the field trigger carries no JavaScript action, or the sandbox's error message |
ElapsedMilliseconds | Wall-clock duration of the evaluation |
ValueBytes | Byte length of the resulting value, against the output-size budget |
Usage notes
- Filled by
THotPDF.EvaluateLoadedFieldJavaScript; on afalseresult the record still explains why, typically inErrorText - Write
Valueback to the field only whenAcceptedistrue; the incremental recalculation helpers follow exactly this rule - Use
OperationCount,ValueBytes, andElapsedMillisecondstogether with theFormScriptBudgetsproperty to diagnose budget violations