[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'fpjson' (#fcl)

# TJSONObject.Get

Retrieve a value by name

## Declaration

Source position: fpjson.pp line 702

`public function TJSONObject.Get(`
`const AName: string`
`):TJSONVariant; function TJSONObject.Get(`
`const AName: string;`
`ADefault: TJSONFloat`
`):TJSONFloat; function TJSONObject.Get(`
`const AName: string;`
`ADefault: Integer`
`):Integer; function TJSONObject.Get(`
`const AName: string;`
`ADefault: Int64`
`):Int64; function TJSONObject.Get(`
`const AName: string;`
`ADefault: QWord`
`):QWord; function TJSONObject.Get(`
`const AName: string;`
`ADefault: TJSONUnicodeStringType`
`):TJSONUnicodeStringType; function TJSONObject.Get(`
`const AName: string;`
`ADefault: Boolean`
`):Boolean; function TJSONObject.Get(`
`const AName: string;`
`ADefault: TJSONStringType`
`):TJSONStringType; function TJSONObject.Get(`
`const AName: string;`
`ADefault: TJSONArray`
`):TJSONArray; function TJSONObject.Get(`
`const AName: string;`
`ADefault: TJSONObject`
`):TJSONObject;`

## Arguments

`AName` |  | Name of the value to retrieve

## Function result

The requested value

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Arguments

`AName` |  | Name of the value to retrieve
`ADefault` |  | Default value to return if no value is found or it has the wrong type.

## Description

Get can be used to retrieve a value by name. If an element with name equal to AName exists, and its type corresponds to the type of the ADefault, then the value is returned. If no element element with the correct type exists, the ADefault value is returned.

If no default is specified, the value is returned as a variant type, or Null if no value was found.

The other value retrieval properties such as Integers, Int64s, Booleans, Strings, Floats, Arrays, and Objects will raise an exception if the name is not found. The Get function does not raise an exception.

## See also

Integers |  | Named access to integer values
Int64s |  | Named access to int64 values
Booleans |  | Named access to boolean values
Strings |  | Named access to string values
Floats |  | Named access to float values
Arrays |  | Named access to JSON array values
Objects |  | Named access to JSON object values

Documentation generated on: May 14 2021