Forum: Object-Pascal / Delphi-Language
Delphi
by Der schöne Günther,
2. Dez 2013
You ignored me :(
I believe I explained why the upcast is necessary.
Forum: Object-Pascal / Delphi-Language
Delphi
by Der schöne Günther,
2. Dez 2013
I don't have the time to dig through your source code right now, but "A || B" means "A or B" whereas "A && B" means "A and B".
"A & B" means that B is evaluated, even if A is already False, same for "A | B". As far as I can remember, Delphi only supports forcefully evaluating the second expression by compiler switches. So pay extra attention if you ever see something like "A|B" or "A&B".
Forum: Object-Pascal / Delphi-Language
Delphi
by Der schöne Günther,
1. Dez 2013
This is sorcery!
Seriously, this is C at its finest not really.
As far as I can see, the upcast to unsigned happens because the byte value is leftshifted by eight! That means it's multiplied by 2^8 = 256. As far as I can remember, just unsigned means unsigned int. Only this way, you're able to store the maximum result value of up to 65535.
This way, your first line means "increase a by...