March 29, 2024, 05:29:03 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


A = B = C ??

Started by Ficko, March 01, 2009, 11:21:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ficko

I was studying the source of "BitmapToRegion" when I run into this line:

"#<RGNDATA>pData.rdh.nCount = #<RGNDATA>pData.rdh.nRgnSize = 0"  :o

I had a guess that it means "nCount = 0" and "nRgnSize = 0" but after testing it I got very dizzy. :-\

The test01:

DEF A,B:INT
OPENCONSOLE
A = 5
B = 6
A = B = 0
PRINT A
PRINT B
DO:UNTIL INKEY$ <> ""

gives :
0
6
:o

The test02:

DEF A,B,C:INT
OPENCONSOLE
A = 5
B = 6
C = 7
A = B = C
PRINT A
PRINT B
PRINT C
DO:UNTIL INKEY$ <> ""

gives:
0
6
7
:o

What this algo supposed to ???
Just makes no sense!?

Ionic Wind Support Team

It's the assignment of a boolean operation.

Thing of it like this:

a = (b = c)

if b equals c then a = 1
if b not equal c then a = 0

In C/C++ it would be:

a = (b == c)

Emergence allows the non parenthesis form because of order of operators rules.  And assignments are not continued between variable pairs.

It may have made more sense to you if you would have encountered

a = b <> c

Depends on what languages you've used in the past.  I know for instance that PureBASIC doesn't support boolean operations like this.

Paul.
Ionic Wind Support Team

Ficko

March 01, 2009, 11:56:38 AM #2 Last Edit: March 01, 2009, 12:09:30 PM by Ficko
Thanks Paul,

I was busy proramming in C# in the last couple of weeks and that language made me very rigid. :(
I just couldn't switch back to EB that easily. ;)

Too much freedom! ;D

Without "==" or "bool" I didn't even consider a boolean expression.