Autor Beitrag
Janus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33



BeitragVerfasst: Sa 08.03.03 18:52 
Kann ich Zahlen auch im Hex Format schreiben oder ausschliesslich im Dezimal Format ???

Bsp. C- Code
int n = 255;
n = 0xff;

Gruss Janus

_________________
Don't give in the hate, that leaves to the dark side of the force !!!
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Sa 08.03.03 19:04 
Mit IntToHex kannst du einen Integer in Hex-Wert umwandeln.

IntToHex(255, 2)

ergibt

FF

und

IntToHex(255, 6)

ergibt

0000FF

als String.

Den Rest, wie z.B. $ davor, mußt du selbst hinzufügen.

In Delphi wäre dann $0000FF als Hexwert üblich. Damit kannst du auch rechnen, z.B.

x := 123 + $AF

Mit StrToInt geht es dann zurück:

x := StrToInt('$0000FF');

_________________
Popov