1

Lazarus is not my favorite dev tool :)

i have a string with json data, how i can parse it, and output specified key,value?

use  ...., fpJSON, JSONParser;   
...
var jsonstring:string;
jsonstring:='[{"id":11,"text":"TEST","description":"Some text","created_at":"2012-04-26 01:50:29","state":"ACCEPTED"},{"id":49,"text":"TEST2","description":"Description test","created_at":"2012-05-01 19:16:43","state":"ACCEPTED"}]'
....
//how print all key 'text' with value (foreach all items and print 'text' and value only)
....
Anton Shevtsov
  • 1,279
  • 4
  • 16
  • 34

1 Answers1

0

Have you tried to search for JSON in your FPC and Lazarus directories? There should be planty of matches (at least there are in my Lazarus CodeTyphon edition). Alternatively, here are the links to get you started:

  1. http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tools/jsonviewer/?root=lazarus&sortby=date
  2. http://code.google.com/p/json-fpk/
  3. http://www.lazarus.freepascal.org/index.php/topic,18348.msg103550.html#msg103550
  4. http://www.lazarus.freepascal.org/index.php/topic,17393.msg95829.html#msg95829
avra
  • 3,690
  • 19
  • 19