Skip to content

TJSONObject.Find

Find an element by name.

Declaration

Source position: fpjson.pp line 724

public 
function Find(const AName: TJSONStringType) : TJSONData;  overload; overload;

function Find(const AName: TJSONStringType; AType: TJSONtype)
              : TJSONData;  overload; overload;

function Find(const key: TJSONStringType; out AValue: TJSONData)
              : Boolean;

function Find(const key: TJSONStringType; out AValue: TJSONObject)
              : Boolean;

function Find(const key: TJSONStringType; out AValue: TJSONArray)
              : Boolean;

function Find(const key: TJSONStringType; out AValue: TJSONString)
              : Boolean;

function Find(const key: TJSONStringType; out AValue: TJSONBoolean)
              : Boolean;

function Find(const key: TJSONStringType; out AValue: TJSONNumber)
              : Boolean;

Description

Find compares the names of all elements in the object with AName and returns the matching element. If none of the element's names match, the function returns Nil

Since JSON is a case-sensitive specification, the names are searched case-sensitively.

If AType is specified then the element's type must also match the specified type.

See also

Name Description
IndexOf Return index of JSONData instance in object.
IndexOfName Return index of name in item list.