Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi constanten festlegen (https://www.delphipraxis.net/94513-constanten-festlegen.html)

ghost007 22. Jun 2007 14:30


constanten festlegen
 
Hallo,
ich möchte folgende konstanten festlegen:
Zitat:

const int KEY_G1 0x00000001
const int KEY_G2 0x00000002
const int KEY_G3 0x00000004
const int KEY_G4 0x00000008
const int KEY_G5 0x00000010
const int KEY_G6 0x00000020
const int KEY_G7 0x00000040
const int KEY_G8 0x00000080
const int KEY_G9 0x00000100
const int KEY_G10 0x00000200
const int KEY_G11 0x00000400
const int KEY_G12 0x00000800
const int KEY_G13 0x00001000
const int KEY_G14 0x00002000
const int KEY_G15 0x00004000
const int KEY_G16 0x00008000
const int KEY_G17 0x00010000
const int KEY_G18 0x00020000

const int KEY_M1 0x00040000
const int KEY_M2 0x00080000
const int KEY_M3 0x00100000
const int KEY_MR 0x00200000

const int KEY_LCDO 0x00400000
const int KEY_LCDLL 0x00800000
const int KEY_LCDLR 0x01000000
const int KEY_LCDRL 0x02000000
const int KEY_LCDRR 0x04000000

const int LCD_LIGHT 0x10000000
const int BG_LIGHT 0x20000000
hab das jetzt mal so probiert ... geht aber nicht :(

Delphi-Quellcode:
const
 KEY_G1 =   0x00000001;
 KEY_G2 =   0x00000002;
 KEY_G3 =   0x00000004;
 KEY_G4 =   0x00000008;
 KEY_G5 =   0x00000010;
 KEY_G6 =   0x00000020;
 KEY_G7 =   0x00000040;
 KEY_G8 =   0x00000080;
 KEY_G9 =   0x00000100;
 KEY_G10=   0x00000200;
 KEY_G11=   0x00000400;
 KEY_G12=   0x00000800;
 KEY_G13=   0x00001000;
 KEY_G14=   0x00002000;
 KEY_G15=   0x00004000;
 KEY_G16=   0x00008000;
 KEY_G17=   0x00010000;
 KEY_G18=   0x00020000;

 KEY_M1 =   0x00040000;   
 KEY_M2 =   0x00080000;   
 KEY_M3 =   0x00100000;   
 KEY_MR =   0x00200000;   

 KEY_LCDO =    0x00400000;
 KEY_LCDLL =   0x00800000;
 KEY_LCDLR =   0x01000000;
 KEY_LCDRL =   0x02000000;
 KEY_LCDRR =   0x04000000;

 LCD_LIGHT =   0x10000000;   
 BG_LIGHT =   0x20000000;
Was mach ich falsch?

Dax 22. Jun 2007 14:31

Re: constanten festlegen
 
Hex-Werte werden in Delphi mit $ statt 0x notiert.

ghost007 22. Jun 2007 14:34

Re: constanten festlegen
 
ah ... ok, danke :) funktioniert

MfG - Ghost007

Christian Seehase 22. Jun 2007 17:35

Re: constanten festlegen
 
Moin Zusammen,

wobei übrigens StrToInt durchaus auch 0x als Hex-Prefix akzeptiert.
(allerdings würde ich mich nicht darauf verlassen, dass das in allen Delphi-Versionen funktioniert).


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz