Advertisement
Guest User

Demo

a guest
Apr 22nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Macro JSONStructure(Buffer, Type, Callback)
  2.   Define Json_#Type = CreateJSON(#PB_Any)
  3.   If IsJSON(Json_#Type)
  4.     InsertJSONStructure(JSONValue(Json_#Type), Buffer, Type)
  5.     Define Result.s = ComposeJSON(Json_#Type, #PB_JSON_PrettyPrint)
  6.     CallFunctionFast(Callback, @Result)
  7.     FreeJSON(Json_#Type)
  8.   EndIf
  9. EndMacro
  10.  
  11. Structure DEMO
  12.   a.i
  13.   b.l
  14. EndStructure
  15.  
  16. Define demo.DEMO
  17.  
  18. demo\a = 10
  19. demo\b = 77
  20.  
  21. Procedure Callback(Json.s)
  22.   Debug Json
  23. EndProcedure
  24.  
  25. JSONStructure(@demo, DEMO, @Callback())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement