Hi, again a string question. I am working on a datastring replacing and deleting characters which I dont want but the StrRemove and StrReplace function doesnt work in the following example
D$ = "1, 0" & CRLF & "2, 0" & "3, 0) & CRLF 'spaces after comma intended
For i = 0 to StrLength(D$)-1
k = StrAt(D$,i)
IF k = " " then 'also ASC(k) = 32 and k = chr(32) dont work
StrRemove(D$," ", 1)
END IF
NEXT
(The reason I am using this FOR next loop is that it also checks for TABS and commas but this code is not included here)
Now the program passes the IF then condition but doesnt remove (or replace the space with another character). Is this due to the FOR NEXT condition in which the string function is stored and if yes how do I edit a string in a function in which the string itself is examined? Or could it be that a DO WHILE {as long as there are spaces in this string -> remove them} function works better, and if yes how do I state the condition to be fulfilled?
I can imagine that after editing, the D$ and i-counter isnt updated in the FOR NEXT loop.
thnx again
Marc
D$ = "1, 0" & CRLF & "2, 0" & "3, 0) & CRLF 'spaces after comma intended
For i = 0 to StrLength(D$)-1
k = StrAt(D$,i)
IF k = " " then 'also ASC(k) = 32 and k = chr(32) dont work
StrRemove(D$," ", 1)
END IF
NEXT
(The reason I am using this FOR next loop is that it also checks for TABS and commas but this code is not included here)
Now the program passes the IF then condition but doesnt remove (or replace the space with another character). Is this due to the FOR NEXT condition in which the string function is stored and if yes how do I edit a string in a function in which the string itself is examined? Or could it be that a DO WHILE {as long as there are spaces in this string -> remove them} function works better, and if yes how do I state the condition to be fulfilled?
I can imagine that after editing, the D$ and i-counter isnt updated in the FOR NEXT loop.
thnx again
Marc