Posted: Sat Nov 01, 2003 2:35 am
I'm one more for the choir:
For MIDI programming, I would like to see strings that can contain ascii zero.

For MIDI programming, I would like to see strings that can contain ascii zero.
http://www.purebasic.com
https://www.purebasic.fr/english/
I strongly agree with this. Also, being able to pass this type of stringgeoff wrote:I'd like to see strings that can contain chr(0). This would greatly simplify the handling of binary files.
PB Strings are zero terminated, i.e. the length isn't stored anywhere. The boundary of 64k comes from the fact, that PB internally allocs 64k for String operation.newtheogott wrote:Currently Purebasic has 16-bit strings.
16 bit= 65536 maximum length.
All other Basic languages have 32 bit strings. Because 32 bit= 2 GB maximum length. Thats just for each string 16 bits more for the lenght part.
Code: Select all
Procedure SetStringManipulationBufferSize(Size)
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, Size)
!MOV dword [_PB_StringBase],eax
EndProcedure
; Set the buffer to 1 100 000 bytes...
;
SetStringManipulationBufferSize(1100000) ; 1,1 Mb for our strings...
; And prove it !
;
For k=0 To 10000
a$ + "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
Next
Debug Len(a$)
YeahFred wrote: So what ?![]()
Not a bad idea, I will may be change the namefsw wrote:Sometimes I think PureMacroASM or PureEasyC would have been more suiteable names....
No and yes. No, they are not affected, but a good lib-function should allocate as much as it'll need.Karbon wrote:And does that affect the internal buffers of some of the string functions?