![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript 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) Example: JsonObject.NewArrayOf methodSee more JSON ExamplesDemonstrates theNewArrayOf method.Note: This example requires Chilkat v11.4.0 or greater.
Use ChilkatAx-win32.pkg Procedure Test Boolean iSuccess String sBig_cats Handle hoJson String sTemp1 Move False To iSuccess Move '["lion","tiger","leopard","jaguar","cheetah","snow leopard","clouded leopard","cougar","puma","panther"]' To sBig_cats Get Create (RefClass(cComChilkatJsonObject)) To hoJson If (Not(IsComObjectCreated(hoJson))) Begin Send CreateComObject of hoJson End Get ComUpdateString Of hoJson "test" "abc" To iSuccess Get ComNewArrayOf Of hoJson "big_cats" sBig_cats To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoJson To sTemp1 Showln sTemp1 Procedure_Return End Set ComEmitCompact Of hoJson To False Get ComEmit Of hoJson To sTemp1 Showln sTemp1 // Result: // { // "test": "abc", // "big_cats": [ // "lion", // "tiger", // "leopard", // "jaguar", // "cheetah", // "snow leopard", // "clouded leopard", // "cougar", // "puma", // "panther" // ] // } End_Procedure |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.