i am confused about using the or-operator
Posted: Thu Apr 03, 2008 4:21 pm
Hi all!
I have a very special problem:
i try to receive two characters with my rs232 component.
First i try to check if the first incoming character is an 'a' or 'b' or 'c'.
If it is one of the following characters, i try to check the second character if it is an 'a' or 'b' ... or 'o'.
At the moment i check every single incoming character with a single if-command. Now i have the problem that i have
more than 45 if-commands in my source code.
When i am trying to use the || in my if-command and compare the incoming rs232 value with my test variable
(if test= 'a' || 'b' || 'c' )
...
...
it doesnt work.
What is my mistake?
plz help me!
Regards,andi
I have a very special problem:
i try to receive two characters with my rs232 component.
First i try to check if the first incoming character is an 'a' or 'b' or 'c'.
If it is one of the following characters, i try to check the second character if it is an 'a' or 'b' ... or 'o'.
At the moment i check every single incoming character with a single if-command. Now i have the problem that i have
more than 45 if-commands in my source code.
When i am trying to use the || in my if-command and compare the incoming rs232 value with my test variable
(if test= 'a' || 'b' || 'c' )
...
...
it doesnt work.
What is my mistake?
plz help me!
Regards,andi