Autor Beitrag
supersass1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 19.09.07 15:15 
hallo,

ich hab iregndwo in meinem Code folgendes stehen:
ausblenden Delphi-Quelltext
1:
DesktopCanvas.Pen.Color := $990000;					


Dort steht ja eine 6-stellige Zahl hinter dem $.

Ich denke mir, dass man dies bestimmt auch durch Zufall generieren lassen kann, oder wie?
ich hab versucht, eine Zahl in a zu speichern, und dann einfach

ausblenden Delphi-Quelltext
1:
DesktopCanvas.Pen.Color := $a;					

, aber dort kam eine Fehlermeldung.


viele liebe grüße


Moderiert von user profile iconGausi: Topic aus Windows API verschoben am Mi 19.09.2007 um 16:18
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 19.09.07 15:18 
Probiers mal so:
ausblenden Delphi-Quelltext
1:
DesktopCanvas.Pen.Color := Random($FFFFFF);					

_________________
We are, we were and will not be.
supersass1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 19.09.07 15:41 
ICh habs mit RGB(byte,byte,byte) gelöst.
Indem ich ein Zufallswer aus 255 oder einsetze.

Vielen Dank trotzdem.
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Mi 19.09.07 17:10 
Als Hinweis:
Das $ bedeutet, dass die Zahl die dahinter steht im Hexadezimalsystem angegeben ist, und nicht, wie
du vielleicht vermutet hattest einfach nur den Variablennamen darstellt. (siehe PHP).