ASCII parse problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

howard123
Posts: 73
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 29 times
Been thanked: 28 times
Contact:

ASCII parse problem

Postby howard123 » Mon Mar 30, 2020 12:04 pm

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.
Attachments
IMG_1083.JPG
IMG_1083.JPG (116.42 KiB) Viewed 346 times
IMG_1082.JPG
debug trace
IMG_1082.JPG (92.86 KiB) Viewed 346 times
Controller A22 ascii range test A01.fcfx
(44.94 KiB) Downloaded 5 times

User avatar
LeighM
Matrix Staff
Posts: 2014
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 691 times
Contact:

Re: ASCII parse problem

Postby LeighM » Mon Mar 30, 2020 12:20 pm

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.
These users thanked the author LeighM for the post:
howard123 (Tue Mar 31, 2020 11:49 am)
Rating: 5%
 

howard123
Posts: 73
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 29 times
Been thanked: 28 times
Contact:

Re: ASCII parse problem

Postby howard123 » Tue Mar 31, 2020 11:51 am

Thanks Leigh that has worked.
Best health wishes to you all.
These users thanked the author howard123 for the post:
Benj (Tue Mar 31, 2020 1:31 pm)
Rating: 5%