Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Problem mit constante und case of (https://www.delphipraxis.net/99719-problem-mit-constante-und-case.html)

ghost007 16. Sep 2007 17:30


Problem mit constante und case of
 
Hallo,
ich hab in meinem projekt folgenden code vorliegen:
Delphi-Quellcode:
.
.
.
const
VK_LG_DB0  = $00400000;
.
.
.
case vkCode of
        .
        .
        .
 VK_LG_DB0    : Result:= 'Toogle';
end;
Nun bekomm ich folgenden Fehler: "Constant expression violates subrange bounds"

=( was bedeutet das ? wie kann ich es beheben ?

MfG - Ghost

Dax 16. Sep 2007 17:32

Re: Problem mit constante und case of
 
Welchen Typ hat vkKeyCode?

ghost007 16. Sep 2007 17:40

Re: Problem mit constante und case of
 
sorry, hab ich vergessen zu erwähnen.
Delphi-Quellcode:
var
 vkCode: Word;
MfG - Ghost

Apollonius 16. Sep 2007 17:46

Re: Problem mit constante und case of
 
Ein Word ist nur zwei Byte groß und kann deshalb nie den Wert der Integerkonstante annehmen, dieser liegt nämlich außerhalb des Wertebereichs.

ghost007 16. Sep 2007 18:21

Re: Problem mit constante und case of
 
also nehm ich einen anderen dateityp anstatt word? welchen ?

MfG - Ghost

mkinzler 16. Sep 2007 18:45

Re: Problem mit constante und case of
 
Integer, Cardinal, ...

idontwantaname 16. Sep 2007 19:11

Re: Problem mit constante und case of
 
DWord (double word)

ghost007 16. Sep 2007 19:39

Re: Problem mit constante und case of
 
danke,
Erledigt


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:07 Uhr.

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