This was a discussion somewhere else in the forum in the past, in a different aspect, but I can't find it now so i'll re-ask the question in a more direct manner then what i remember that other discussion being:
How come PB string functions like FindString, StringByteLength, etc....exclude the terminating null of a string in their returns?
a string "123456" - Len("123456") = 6 - StringByteLength("123456") = 6 - FindString("123456", Chr(0), 1) = 0 (or FindString("123456", #Null$, 1) = 0)
strings in PB consume memory at "string length + 1" (so I assume strings in PB automatically include a terminating null)
How come...
How come...
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: How come...
Because a PB string it's a particular kind of memory buffer, cannot contain a $00 by definition.
$00 is the termination char. It something beyond the string. It's not part of the string.
It's simply a convention.
$00 is the termination char. It something beyond the string. It's not part of the string.
It's simply a convention.
"Have you tried turning it off and on again ?"
Re: How come...
SizeOf(Character) is your friend. 
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: How come...
PrintN is nice. The sky is blue.skywalk wrote:SizeOf(Character) is your friend.
"Have you tried turning it off and on again ?"
Re: How come...
yeah, I use SizeOf(Character) a lotskywalk wrote:SizeOf(Character) is your friend.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: How come...
Yep, thats it, just could not remember. Thanks luisluis wrote:Because a PB string it's a particular kind of memory buffer, cannot contain a $00 by definition.
$00 is the termination char. It something beyond the string. It's not part of the string.
It's simply a convention.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
