Search code examples
delphic++builderc++builder-xe2

String type in c++builder (RAD XE2) handle 2047 character only?


I have a project with Indy (using RAD XE2) and I get a return string from IdHTTP like: String result = IdHTTP->Get(url); the problem is reuslt is limited at 2047 character lenght. How can i handle full return string? Thank you.

Edit: This issue occurs when in debug mode only (using Step into).


Solution

  • There's no inherent limit to the length of a string. More likely is that your debugging activities are interrupting the network activities, interfering with your program's ability to read everything off the socket before the debugger pauses it.

    Stop trying to single-step through asynchronous I/O, and you'll probably see better results.

    Also note that the debugger's watch window won't necessarily show you the entire contents of a variable, so if you're only seeing 2047 characters in the debugger, that doesn't necessarily reflect the actual length of the string. Call Length instead.