Find the "null" character
You cannot search the character null ( chr$(0) ) with INSTR because chr$(0) is the string END delimiter (for the INSTR function, not for the eWON).
d% = Instr 1, b$, Chr$(00)
is like asking the INSTR to search an "empty string" inside the b$ string. And strangely, it succeeds directly.
If you need to search the character null, you must search it manually inside the string.
Create a string with a null character inside such as:
b$ = "hello"+chr$(0)+"bonjour"
When you print it, it displays only the "hello" part
BUT you can see that the length of this b$ is well equal to 13:
And if you search manually with the fonction below, you'll find that position==6:
SearchNull: position=0 For i%= 1 To LEN(B$) If B$(i%)=Chr$(0) Then position=i% Endif Next i% Print "pos ";position End