Page 1 of 1

hack >64k strings is fixed...

Posted: Thu Dec 02, 2004 6:06 pm
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$)


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

Posted: Thu Dec 02, 2004 7:45 pm
by PB
Good news! Thanks for letting us know. :)

Posted: Fri Dec 03, 2004 9:28 am
by gnozal
Very good news, thanks :D