Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #265 // json.encode / json.decode (standard include)

Lua code

function loadDKJSON(sID)
  local env = setmetatable({}, {__index=function(o, k) return _G[k] end })
  return assert(loadSnippet(sID, env))()
end

json = loadDKJSON('#44')

--now you can do stuff like:
--print(json.encode{'hello', 'world'})
--print(json.encode{a='hello', b=2})
--t = json.decode('["hello","world"]')
--print(t[1], t[2])

Author comment

Use with: go("#265")

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 346 [visualize]

Snippet ID: #265
Snippet name: json.encode / json.decode (standard include)
Eternal ID of this version: #265/1
Text MD5: 0e0d4c4b0f5bf3d8b6b086c6faa56db9
Author: stefan
Category: standard includes
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-03-29 13:09:22
Source code size: 346 bytes / 12 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 679 / 200
Referenced in: [show references]