Skip to main content

Json

function Json: TJSONObject;

Example

procedure ScriptEvent(var Value: variant);
begin
Json.LoadFromString('{"status":"ready"}');
Value := Json.OptString('status', '');
end;

Usage

Json provides the first reusable JSON object workspace for the current action. Use its load, member, combine and delete operations to build or inspect an object tree. Changes remain visible to later scripts in the same action.

Json is separate from Json2, ExtraData, JsonArray and JsonArray2; Velox does not copy or synchronise them. Clear or reload it before using it for unrelated data. Reading Json does not automatically parse map input or create output.

Additional Technical Info

Json 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.

PropertyDetail
Return typeTJSONObject
OwnershipAction-owned and shared across the action's scripts
Creation/accessGetter call; see lifecycle below
Thread safetyMutable and not safe for concurrent/asynchronous use

Failures, safety and implementation cautions

Erase or load known content before reuse, use typed optional accessors for optional members and distinguish missing, null, empty and type-mismatched values. Do not free the object or retain member pointers after the action. Bound untrusted JSON size/depth and avoid logging secrets.

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

  • TJSONObject documents the returned class and its exposed methods/properties.
  • Helpers compares lifetime, sharing and context rules for all helper objects.

External references

  • RFC 8259: JSON defines the interchange syntax; the Velox class page defines the exposed API.
Created 2026-07-15