#PB_String_WithZero for StringByteLength()
#PB_String_WithZero for StringByteLength()
In accordance with #PB_String_NoZero for PokeS() and PeekS()
Re: #PB_String_WithZero for StringByteLength()
Code: Select all
StringByteLength(String.s)+SizeOf(Character)
Re: #PB_String_WithZero for StringByteLength()
I use something like
(warning: that Format trick assumes #PB_Unicode = #PB_ASCII + 1)
Code: Select all
Macro StringByteLengthN(String, Format = #PB_Ascii + #PB_Compiler_Unicode)
(StringByteLength(String, Format) + 1 + Bool(Format = #PB_Unicode))
EndMacro
Debug StringByteLengthN("Hello")
Debug StringByteLengthN("Hello", #PB_Ascii)
Debug StringByteLengthN("Hello", #PB_UTF8)
Debug StringByteLengthN("Hello", #PB_Unicode)