View previous topic :: View next topic |
Author |
Message |
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 584 Location: Cleveland, OH
|
Posted: Thu Jun 11, 2020 2:41 am Post subject: |
|
|
That puts two operators on the same line, which will confuse the compiler.
One approach would be:
Code: |
If A <> B then
C = 1
Else
C = 0
End If
|
JC |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Thu Jun 11, 2020 5:37 am Post subject: |
|
|
Hi JC !!
Brilliant!! I was going to do this but I already understood and thank you very much JC !!!!! |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Thu Jun 11, 2020 8:23 am Post subject: |
|
|
C = A = B
C = A > B
These arithmetic expressions put True[1] or False[0] of the calculation result in the variable C.
C = A <> B
The above is probably a BASCOM oversight or bug.
However, as JC says, it is possible to directly judge True or False by the IF statement, so the situation where this operator is used is limited. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Thu Jun 11, 2020 6:22 pm Post subject: |
|
|
C = A <> B
The above is probably a BASCOM oversight or bug
You have to work but I don't know how strange I get Bascom error
|
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Fri Jun 12, 2020 12:49 am Post subject: |
|
|
To resolve this issue, please contact MCS Support and ask Mark to update! |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Fri Jun 12, 2020 1:15 am Post subject: |
|
|
Code: |
Dim A As Byte , B As Byte , C As Byte
A = B = C
A = Not A.0
|
e |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Fri Jun 12, 2020 5:29 am Post subject: |
|
|
O-Family wrote: | To resolve this issue, please contact MCS Support and ask Mark to update! |
Yes and thank you very much !!! |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Thu Jul 16, 2020 7:00 pm Post subject: Re: COMPARATIVE OPERATORS_ARDUINO UNO |
|
|
With my new update to 2.0.8.3 it works fine !!! |
|
Back to top |
|
|
olhexy
Joined: 03 Apr 2011 Posts: 192 Location: Tilburg, Netherlands
|
Posted: Sat Jul 18, 2020 7:51 am Post subject: |
|
|
enniom wrote: | Code: |
Dim A As Byte , B As Byte , C As Byte
A = B = C
A = Not A.0
|
e |
A= Not A.0 ( A is not A dot zero)
What is de exact meaning of that dot (".") ????
EDIT:
I think I found it.
It is hard to find in the Help, but I got a hint at Set, Reset.
This is how I understand it:
A.0 means bit nr 0 of A.
A can be a byte or word.
The bit nr can be 0, 1, ..., 6, 7 in a byte, or 0, 1, ..., 14, 15 in a word. |
|
Back to top |
|
|
|