Json.Encode

From GMod Wiki

Jump to: navigation, search
Function
Syntax Json.Encode( Var data )
Where is this used?
Description:
Encodes a variable. See Notes.
Returns: nil
Part of Library: Json
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Json.Encode]Json.Encode [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionEncodes a table using Json
Used onNewerShared.png
Code
 
  local t = {
    "var1" = 21,
    "var2" = 24
  }
 
  Json.Encode(t);
 
 
  print( Json.Decode(t) )
 
Output"var1":21, "var2":24
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox