Structure TEXT
String.b[11] ;<----- Does this have to be 11 to make room for the null?
EndStructure
test.TEXT
PokeS(@test\String, "1234567890") ;<----- string length of 10 characters
Debug PeekS(@test\string)
The description of PokeS() says "Write a string (including the ending '0') to the specified memory address". That sounds like the byte array does have to be 11 bytes long to allow for the null terminator. This agrees with the usage in C/C++, which arrays in PB structures are supposed to match.
One should read the manual description of all commands!
P4 2.4GHz, 256 MB, WinXP Pro, onboard video&audio.
The Programmer's Drinking Song:
"99 little bugs in the code,
99 little bugs.
Fix one bug, recompile
100 little bugs in the code."
i'm trying to convince people that we need fixed length strings in purebasic... (see the thread in 'feature request and wishlist') but haven't been able to convince people yet...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!Please visit my YouTube Channel