![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Using JSON StringOf with Non-String MembersSee more JSON ExamplesIf a JSON member is a boolean, integer, or null, usingStringOf will return its string representation.
integer li_rc oleobject loo_Json string a string b string c integer li_Ival integer li_Bval integer li_HasNull // Create JSON with members of different data types. loo_Json = create oleobject li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") if li_rc < 0 then destroy loo_Json MessageBox("Error","Connecting to COM object failed") return end if loo_Json.UpdateInt("a",123) loo_Json.UpdateBool("b",1) loo_Json.UpdateNull("c") loo_Json.EmitCompact = 0 Write-Debug loo_Json.Emit() // Resulting JSON: // { // "a": 123, // "b": true, // "c": null // } a = loo_Json.StringOf("a") Write-Debug a b = loo_Json.StringOf("b") Write-Debug b c = loo_Json.StringOf("c") Write-Debug c // Output // 123 // true // null // If you want to get the integer, boolean, or null value // you need to use the methods matching the data type li_Ival = loo_Json.IntOf("a") li_Bval = loo_Json.BoolOf("b") li_HasNull = loo_Json.IsNullOf("c") destroy loo_Json |
||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.