Forum: Object-Pascal / Delphi-Language
Delphi
by Dannyboy,
16. Aug 2004
Es gibt auch noch diese Möglichkeit:
var a,b : byte;
//...
Großes Halbbyte:
a:= (b AND 240); // 240 = 1111 0000
Kleines Halbbyte:
a:= (b AND 15); // 15 = 0000 1111
Hier kannst Du Dir beide Halbbytes raussuchen und
nicht nur den unteren Teil.
DANNYBOY
Forum: Object-Pascal / Delphi-Language
Delphi
by Dannyboy,
16. Aug 2004
Servus, um Halbbytes zu bekommen shiftest Du am besten die Bits mit shl und shr
(shift-left und shift-right).
Beispiel für kleines Halbbyte:
Z.B.: var a,b : byte;
b:= 255;
a:= b shl 4;
Check this out.
DANNYBOY