procedure TForm1.Button1Click(Sender: TObject);
var
C:TColor;
ByteArray:
Array[0..3]
of byte
absolute C;
ACharArray:
Array[0..3]
of AnsiChar
absolute C;
StringAusCharacters,StringAusBytes:
String;
i:Integer;
begin
C :=
RGB(65,66,67);
Memo1.Lines.Add('
Zahlendarstellung der Bytes:');
for i := 0
to 3
do Memo1.Lines.Add(IntToStr(ByteArray[i]));
Memo1.Lines.Add('
Umformungen');
for i := 0
to 3
do
begin
StringAusCharacters := StringAusCharacters + ACharArray[i];
StringAusBytes := StringAusBytes + Char(ByteArray[i]);
Memo1.Lines.Add(IntToStr(ORD(ACharArray[i])) +'
='+ IntToStr(ByteArray[i]) +'
- ' + ACharArray[i] + '
=' + Char(ByteArray[i]));
end;
Memo1.Lines.Add('
String aus Charakters');
Memo1.Lines.Add(StringAusCharacters);
Memo1.Lines.Add('
String aus Bytes');
Memo1.Lines.Add(StringAusBytes);
for i := 0
to 3
do ACharArray[i] := #0;
ACharArray[0] := Char(255);
Memo1.Lines.Add(ColorToString(c));
for i := 0
to 3
do ByteArray[i] := 0;
ByteArray[1] := 255;
Memo1.Lines.Add(ColorToString(c));
Memo1.Lines.Add('
Setzen auf clBlue');
c := clBlue;
for i := 0
to 3
do
Memo1.Lines.Add(IntToStr(ByteArray[i]));
Memo1.Lines.Add('
1* shr 8');
c := c
shr 8;
for i := 0
to 3
do
Memo1.Lines.Add(IntToStr(ByteArray[i]));
Memo1.Lines.Add('
1* shr 8');
c := c
shr 8;
for i := 0
to 3
do
Memo1.Lines.Add(IntToStr(ByteArray[i]));
end;