json class : Get(string) method

Description

Gets a value corresponding to a member name of an instance.

Syntax

jsonInstance.Get(string memberName)

Arguments

ClassNameDescription
stringmemberNameA member name.

Return value

ClassDescription
real,string,bool,json, or jsonnullA value of the member.

Sample code

1:

json jsonIns = new json("{@name@:@suzuki@,@age@:1}".Replace("@","".DQ));

2:

string nameVal = jsonIns.Get("name"); // "suzuki"

3:

real ageVal = jsonIns.Get("age"); // 1.0

Notes

If the instance is an JSON array, an exception is raised.

If there is no member corresponding to the member name, an exception is raised.

Only members that are direct children are searched.

Please note that the return value class is not one.

Links for reference

None

Copyright © Cooker All rights reserved.