You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Returns a list of a JSON object's members.

Syntax

Result = SRP_Json(Handle, "GetMember", Delimiter)

Returns

Returns a dynamic array containing all the object's member names.

Parameters

ParameterDescription
HandleHandle to a JSON Entity. Required.
DelimiterThe delimiter to use between each member name. Optional.

Remarks

The GetMember service returns a list of all member names within a JSON object. It does not return the members' values, only their names. If you need a member's value, then you can use the GetValue service.

This service only works if Handle is a JSON object. If it is not an object, the result will be "". Also, if the object has no members, the result will be "". The Delimiter parameter is optional. If you omit the parameter, then @FM is used. Delimiter must be a single character.

Example

// Create a JSON object
If SRP_Json(ObjectHandle, "New", "OBJECT") then
   
   // Add some members to it
   SRP_Json(ObjectHandle, "SetValue", "name", "John Doe")
   SRP_Json(ObjectHandle, "SetValue", "city", "Washington D.C.")
   
   // Get the list of members, delimited by ~
   Members = SRP_Json(ObjectHandle, "GetMember", '~')

   // If you want an @FM delimited list, just omit the last parameter
   Members = SRP_Json(ObjectHandle, "GetMember")

   // Remember to release entities you've created
   SRP_Json(ObjectHandle, "Release")
   
 end

See Also

GetCountGetValue

  • No labels