JsonWriter.BeginObjectmethod
Structures control with inline suppression.
Syntax
SUB BeginObject
Description
Structures control with inline suppression.
Purpose: Emits “{”, increases depth, pushes a “first item” flag, and inserts newline+indent.
Examples
#include once "AfxNova/AfxJson.inc" USING AfxNova
DIM esc AS DWSTRING = "Quote: """ & " Newline: " & WCHR(10) & "Tab: " & WCHR(9) & "End" DIM jw AS JsonWriter jw.SetIndentSize(2) jw.BeginObject() jw.Name("s") : jw.Value(esc) jw.Name("i64") : jw.Value(9223372036854775807) ' max signed 64 jw.Name("pi") : jw.Value(3.141592653589793) jw.Name("ok") : jw.ValueVariant(DVARIANT(TRUE, "BOOLEAN")) ' VT_BOOL -> true jw.Name("none") : jw.ValueVariant(DVARIANT()) ' VT_EMPTY -> null jw.EndObject() print jw.ToUtf8
#include once "AfxNova/AfxJson.inc" USING AfxNova
Dim jw As JsonWriter jw.SetIndentSize(2) jw.BeginObject() jw.Name("app") : jw.Value("AfxNova") jw.Name("version") : jw.Value(1) jw.Name("author") jw.BeginObject()
jw.Name("name") : jw.Value("José Roca")
jw.Name("site") : jw.Value("https://github.com/JoseRoca/AfxNova")
jw.Name("active"): jw.ValueVariant(DVARIANT(TRUE, "BOOLEAN"))
jw.EndObject() jw.Name("notes") : jw.Value("All UTF-16 internally") jw.EndObject() print jw.ToBString
Primitives + string escaping
Nested objects
Reference
- Defined in AfxNova/AfxJson.inc:506
- Documented in WebView/Json Classes.md
- Topic: JSON Reader and Writer classes