Inserting text in strings

Just starting out? Need help? Post your questions and find answers here.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Wilbert, your example crashes when used with ReplaceString, so it's probably
best to just wait until v4.00 when PureBasic will support unlimited strings, or
at least avoid using ReplaceString. However, I found that when using strings
larger than 63999 bytes that my app kept crashing at random times, so I've
avoided a tip similar to yours as a result. Wait for the official fix.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

ukandrewc,

The 64k limit is mainly down to allocating strings.

I think you're best approach is to keep going as you are, and if you find any of the procedures fail with larger string write an equivalent using pointers.

You'll probably want to rewrite them anyway to get the speed benefits.
ukandrewc
User
User
Posts: 31
Joined: Fri May 28, 2004 12:07 am

Post by ukandrewc »

Yes, after the advice I have written my own mid function that uses pointers.

Thanks again everyone
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

Dare2 wrote:hehe.

There is a thread here somewhere where large strings were discussed. (I can't find the thread now so maybe it was in th bugs area and dopped or maybe I am searching badly - but I remember seeing it)

From recollection (vague) the conclusion was that very large strings give the illusion of being OK, but cause probs down the track. There was also some sort of work-around which was hotly argued.
viewtopic.php?t=9194
ukandrewc
User
User
Posts: 31
Joined: Fri May 28, 2004 12:07 am

Post by ukandrewc »

FYI

I discovered that there is a command for my problem, CopyMemoryString is documented in the help file

Thanks again
Post Reply