I was working on a parsing routine of mine, when I could not figure out a problem I was having, and started printing asc values of each character when I found in every string starts with chr$(-1)
Is this normal? I usually never see this because I start parsing at the 1st character, not 0. (Example below how I can replicate this)
An empty string does not have this starting "-1" character and I can not seem to replace the character with nothing, nor any other character????
How do I get rid of it? It is causing problems in routines that I am purposely looking for a -1 as being the character returned (although I do not know what that character is called???)
Is this normal? I usually never see this because I start parsing at the 1st character, not 0. (Example below how I can replicate this)
Code:
#COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL TestString AS STRING LOCAL i AS LONG TestString = "Hello" REPLACE CHR$(-1) WITH "" IN TestString FOR i = 0 TO LEN(TestString) MSGBOX STR$(ASC(MID$(TestString, i, 1))) NEXT i IF INSTR(TestString, CHR$(-1)) THEN MSGBOX " -1 char found in TestString " + FUNCNAME$ MSGBOX STR$(VARPTR(TestString)) END FUNCTION
How do I get rid of it? It is causing problems in routines that I am purposely looking for a -1 as being the character returned (although I do not know what that character is called???)
Comment