PowerBuilder
PowerBuilder
Using Chilkat StringBuilder to Avoid Large Strings
See more uncategorized Examples
Some 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.
Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Http
oleobject loo_Json
string ls_JsonStr
oleobject loo_Sb
li_Success = 0
loo_Http = create oleobject
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
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
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