![]() |
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
(DataFlex) 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.
Use ChilkatAx-win32.pkg Procedure Test Handle hoJson Boolean iSuccess String a String b String c Integer iIval Boolean iBval Boolean iHasNull String sTemp1 // Create JSON with members of different data types. Get Create (RefClass(cComChilkatJsonObject)) To hoJson If (Not(IsComObjectCreated(hoJson))) Begin Send CreateComObject of hoJson End Get ComUpdateInt Of hoJson "a" 123 To iSuccess Get ComUpdateBool Of hoJson "b" True To iSuccess Get ComUpdateNull Of hoJson "c" To iSuccess Set ComEmitCompact Of hoJson To False Get ComEmit Of hoJson To sTemp1 Showln sTemp1 // Resulting JSON: // { // "a": 123, // "b": true, // "c": null // } Get ComStringOf Of hoJson "a" To a Showln a Get ComStringOf Of hoJson "b" To b Showln b Get ComStringOf Of hoJson "c" To c Showln 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 Get ComIntOf Of hoJson "a" To iIval Get ComBoolOf Of hoJson "b" To iBval Get ComIsNullOf Of hoJson "c" To iHasNull End_Procedure |
||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.