First, this is not critical. I am in the exploratory stage, only, and open to looking at other solutions to my problem.
My PowerBuilder application needs to do (potentially) thousands of concatenations to a single string variable. True to form, PB slows down as the immutable string is appended over and over. Totally understandable with an immutable type.
Per the book "PowerBuilder 9: Advanced Client/Server Development", I'd like to write my own string handler (like a C# StringBuilder equivalent) in C++ and then "create a PBNI PowerBuilder object to use in place of the native string function".
Reading through the PowerBuilder Native Interface Programmers Guide and Reference it looks like I need to use the PBString type in C++ which does not seem to be mutable in the C++ world, either.
- Is the PBNI PBString type mutable or immutable?
- Is the PBNI PBString limited to 32K like its PB counterpart or is it more like std::string which will utilize as much available RAM as needed?
- Can my exposed function use a std::string parameter type or will PB choke on that, expecting PBString?
Disclaimer: As you may have discerned, C++ is not my thing and this is my first stab at PBNI.
I have tried to write the C++ DLL code, but I cannot figure out how to append the incoming strings because C++ appears to only pass pointers. I have not been able to find out how to get the real string value. If I have to convert from pointer to PBString to std::string, then this is a pointless exercise, anyway.
Does PB already have a mutable string type that I have either missed for 25 years? Is Appeon thinking about it? I've tried using Blobs instead of Strings, but the performance is the same.