Difference between revisions of "LlList2Json"

From Second Life Wiki
Jump to: navigation, search
m
m
Line 35: Line 35:
 
|history = Date of Release  [[ Release_Notes/Second_Life_Server/13#13.05.20.276191 | 20/05/2013 ]]
 
|history = Date of Release  [[ Release_Notes/Second_Life_Server/13#13.05.20.276191 | 20/05/2013 ]]
 
|haiku={{Haiku|Their ships list to port|for what reason I know not|we list to JSON}}
 
|haiku={{Haiku|Their ships list to port|for what reason I know not|we list to JSON}}
 +
{{Haiku|Listen to Jason|cryptically my sensei said|I must have misheard}}
 
}}
 
}}

Revision as of 11:29, 28 August 2013

Summary

Function: string llList2Json( string type, list values );

This function takes a list and returns a JSON string of that list as either a json object or json array.
Returns a string that is either values serialized as a JSON type, or if an error was encountered JSON_INVALID.

• string type
• list values

To convert a json formatted string into a list use llJson2List.

Specification

See Json_usage_in_LSL

  • If type is JSON_OBJECT the list must be a strided list of key, value pairs and a string representing a json object will be returned.
  • If type is JSON_ARRAY then a string representing a json array will be returned.
  • If type is any other string then JSON_INVALID will be returned.
Type Flags Value Unicode URL Encoded HTML Encoded Description
JSON_INVALID U+FDDO "%EF%B7%90"  Value returned when inputs are not well formed.
JSON_OBJECT U+FDD1 "%EF%B7%91" 
JSON_ARRAY U+FDD2 "%EF%B7%92" 

Examples

See Also

Constants

•  JSON_ARRAY
•  JSON_OBJECT
•  JSON_INVALID

Functions

•  llJson2List
•  llJsonGetValue
•  llJsonSetValue
•  llJsonValueType

Articles

•  Typecast

Deep Notes

History

Date of Release 20/05/2013

Search JIRA for related Issues

Signature

function string llList2Json( string type, list values );

Haiku

Their ships list to port
for what reason I know not
we list to JSON

Listen to Jason
cryptically my sensei said
I must have misheard