Difference between revisions of "PRINT JSON()"

From Lianjapedia
Jump to: navigation, search
Line 3: Line 3:
  
 
==Syntax==
 
==Syntax==
PRINT_HTML(<object-ref>)
+
PRINT_JSON(<object-ref>)
  
 
==See Also==
 
==See Also==
Line 14: Line 14:
 
<code lang="recital">
 
<code lang="recital">
 
open database southwind
 
open database southwind
select * from shippers into object shipobj
+
select * from shippers into json shipobj
print_html(shipobj)
+
print_json(shipobj)
 
</code>
 
</code>
  

Revision as of 06:26, 23 November 2012

Purpose

Display object in JavaScript Object Notation (JSON)

Syntax

PRINT_JSON(<object-ref>)

See Also

ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), JSON_ENCODE_FILE(), LIST CLASSES, LOADOBJECT(), NEWOBJECT(), OBJECT(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH

Description

The PRINT_JSON() function is used to display the specified object, <object-ref>, in JavaScript Object Notation (JSON).

Example

open database southwind
select * from shippers into json shipobj
print_json(shipobj)
shipobj:{row1:{shipperid:1,companyname:"Speedy Express",phone:"(503) 555-9831"},
	row2:{shipperid:2,companyname:"United Package",phone:"(503) 555-3199"},
	row3:{shipperid:3,companyname:"Federal Shipping",phone:"(503) 555-9931"}}