Page 1 of 1

ASCII parse problem

Posted: Mon Mar 30, 2020 12:04 pm
by howard123
Hello all,

I am trying to parse a certain range of ASCII values bounded at decimals 48 and 122.

The input is “+++abcde}}}” and I would expect to get “abcde” but I instead get “abcde67891234567..”.

Notice that StringCellNumber=”” is after StringCellNumber=123456789123456789. Notice also that the number of characters is more than the number of loops(11).

If I remove the parse loop (shown screenshot) I correctly get nothing on the display for StringCellNumber (StringTestTwo).

On my debug pic the top line is StringTestOne and the lower StringTestTwo.

Any ideas? thanks Howard.

Re: ASCII parse problem

Posted: Mon Mar 30, 2020 12:20 pm
by LeighM
You need to add a final null (0) after the last character written into StringCellNumber
This terminates the string.
Otherwise any preexisting characters in the array will be included in the string.

Re: ASCII parse problem

Posted: Tue Mar 31, 2020 11:51 am
by howard123
Thanks Leigh that has worked.
Best health wishes to you all.