PDA

View Full Version : Data w/o physical file to JSON


ktoole
03-17-2010, 10:59 AM
Is it possible to send more than one data field with one of the RPG API's you have to a JSON data store with out using an external file description?

This is what your description of Valence says, but I can't figure out how to send more than one field to a screen grid without using a physical file.

Send physical file or RPG array data directly into front-end browser grids, trees, etc. (and vice-versa).

sean.lanktree
03-17-2010, 11:09 AM
If your response is not based on an external structure, then you either have to build up the response yourself:


d myString s 5000a varying
/free
myString = '{"ROOT":[{"FLDA":1,"FLDB":"ABC" // etc....

vvOut_data(myString:JSON);


Or, if not an array of data, you can use vvOut_toJsonPair:


/free
vvOut_toJsonPair('FLDA:1,FLDB:2,FLDC:3');