JsonWriter.Valuemethod
Emits a JSON string with escaping for quotes, backslashes, control chars, and nonprintables via \uXXXX.
Syntax
SUB Value (BYREF s AS WSTRING)
SUB Value (BYVAL n AS LONGINT)
SUB Value (BYVAL n AS DOUBLE)
Parameters
| Name | Description | |
|---|---|---|
s | The string to emit. | |
n | The number to emit. |
Description
Emits a JSON string with escaping for quotes, backslashes, control chars, and nonprintables via \uXXXX.
The numbers are converted to string with WSTR.
Examples
#include once "AfxNova/AfxJson.inc" USING AfxNova
DIM uni AS DWSTRING = "España — café — ?x" DIM jw AS JsonWriter jw.SetIndentSize(2) jw.BeginObject() jw.Name("title") : jw.Value("Unicode test") jw.Name("text") : jw.Value(uni) jw.EndObject() AfxMsg jw.ToBString
Unicode text (BMP): accents, em dash, Greek
Reference
- Defined in AfxNova/AfxJson.inc:566
- Documented in WebView/Json Classes.md
- Topic: JSON Reader and Writer classes