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

11
LINES

< > BotCompany Repo | #77 // dkjson test

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')

print(json.encode{'hello', 'world'})
print(json.encode{a='hello', b=2})
t = json.decode('["hello","world"]')
print(t[1], t[2])

Author comment

works!! :)

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

2 comment(s) hidden. show

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 308 [visualize]

Snippet ID: #77
Snippet name: dkjson test
Eternal ID of this version: #77/1
Text MD5: 293b5e28e535f8879e6e4070a6764b8e
Author: stefan
Category: tests
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-01-02 06:34:22
Source code size: 308 bytes / 11 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 1563 / 766
Referenced in: [show references]