Comparing strings

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

Moderators: Benj, Mods

Post Reply
User avatar
vidor
Posts: 42
Joined: Mon Jan 28, 2008 4:56 pm
Location: Sweden

Comparing strings

Post by vidor »

Hi all,

I want to compare two strings: ID_RX[] = ID_string[].
Both are two digits long. 01 to 99.
I tried with: ID_RX[0] = ID_string[0] AND ID_RX[1] = ID_string[1] in a Decision box, but is not working.
I tried with: ID_RX[Index] = ID_string[Index] but the result is the same, not working.
It would be a solution to compare the first digit when it comes through RS232, and the second after that.
I wanted, to read in the two digits and compare after.
Is there any solution?
Thanks in advance
Regards
Vidor

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Comparing strings

Post by Steve »

Try this:

Code: Select all

(ID_RX[0] = ID_string[0]) && (ID_RX[1] = ID_string[1])
The word "AND" is used for a bitwise-And, not a logical-And.

User avatar
vidor
Posts: 42
Joined: Mon Jan 28, 2008 4:56 pm
Location: Sweden

Re: Comparing strings

Post by vidor »

Thank you Steve, now it works fine.
Best regards
Vidor

Post Reply