Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Using Chilkat StringBuilder to Avoid Large StringsSome programming languages can have limitations on string lengths, or it can be inefficient to return large strings back to the application, only to be passed back into Chilkat in a subsequent method call. For Chilkat functions that return a string where the returned string can potentially be very large, there is typically the same function with the name ending in "Sb", where the returned string is deposited into the last argument. This allows for the string remain within an object, and thus never marshalled to/from the application.
integer li_rc oleobject loo_Http oleobject loo_Json string ls_JsonStr integer li_Success oleobject loo_Sb loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if loo_Json = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") // This is the potentially inefficient way of getting JSON from a URL and loading it into a Chilkat JsonObject. // It gets the string directly.. ls_JsonStr = loo_Http.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json") li_Success = loo_Json.Load(ls_JsonStr) // This is the more efficient method if the JSON is potentially large loo_Sb = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_Sb.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",loo_Sb) li_Success = loo_Json.LoadSb(loo_Sb) destroy loo_Http destroy loo_Json destroy loo_Sb |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.