JsonArray2
function JsonArray2: TJSONArray;
Example
procedure ScriptEvent(var Value: variant);
begin
JsonArray2.Erase;
JsonArray2.AddString('Comparison');
Value := JsonArray2.Count;
end;
Usage
JsonArray2 provides a second reusable JSON array workspace for the current action. Use it when two arrays must coexist, such as source and destination collections. Velox does not assign those meanings or copy, compare or synchronise the arrays automatically.
It is separate from JsonArray. Changes remain visible to later scripts in the same action, so clear or reload it before using it for unrelated data.
Additional Technical Info
JsonArray2 is a no-argument Velox scripting helper that returns a live object. It does not copy the object or make the returned reference private to the calling statement.
| Property | Detail |
|---|---|
| Return type | TJSONArray |
| Ownership | Action-owned and shared across the action's scripts |
| Creation/access | Getter call; see lifecycle below |
| Thread safety | Mutable and not safe for concurrent/asynchronous use |
Failures, safety and implementation cautions
Initialise it explicitly and do not assume it is a snapshot of JsonArray. Validate item types and bounds, do not free it or retain item pointers after the action, and constrain untrusted data size/depth.
Class methods can raise on invalid state, parsing/conversion failures, I/O errors or invalid arguments unless their own contract documents a different result. Copy required scalar results before another script or operation can replace mutable state.
Related entry
TJSONArraydocuments the returned class and its exposed methods/properties.Helperscompares lifetime, sharing and context rules for all helper objects.
External references
- RFC 8259: JSON defines array syntax and interoperability constraints.