hack >64k strings is fixed...

Share your advanced PureBasic knowledge/code with the community.
DEU.exe
User
User
Posts: 13
Joined: Sun Oct 19, 2003 11:21 am
Location: www

hack >64k strings is fixed...

Post by DEU.exe »

Code updated For 5.20+

See this topic: viewtopic.php?t=9194

After update http://www.purebasic.com/update/ from November 30th, the 64k limit is gone!

ReplaceString, RemoveString is working.

Code: Select all

; 
; Procedure SetStringManipulationBufferSize(Bytes)
;       PBStringBase.l = 0
;       PBMemoryBase.l = 0
;       !MOV eax, dword [PB_StringBase]
;       !MOV [esp+4],eax
;       !MOV eax, dword [PB_MemoryBase]
;       !MOV [esp+8],eax
;       HeapReAlloc_(PBMemoryBase, #GMEM_ZEROINIT, PBStringBase, Bytes)
;       !MOV dword [_PB_StringBase],eax
;     EndProcedure
; 
;     ; Set the buffer size for all strings to 1 MB.
;     SetStringManipulationBufferSize(1048576)
A$ = Space(1000000)+"test"

; NO MORE CRASH 1 - ReplaceString()
A$ = ReplaceString(A$,"test","pure")
Debug Right(a$,4)

; NO MORE CRASH 2 - RemoveString()
A$ = RemoveString(A$,"pu")
Debug Right(A$,2)

Debug Len (A$)

pIII@1Ghz, wXP, 512MB, pb3.93full
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: hack >64k strings is fixed...

Post by PB »

Good news! Thanks for letting us know. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Very good news, thanks :D
Post Reply