![]() |
Case Is of
Delphi-Quellcode:
wie war es noch..
case DisplayMin of
9: möchte prüfen ob DisplayMin größer als 9 ist. gruss |
AW: Case Is of
Delphi-Quellcode:
? oO
if DisplayMin > 9 then ...
Sry aber ich glaub ich versteh die Frage nicht^^ |
AW: Case Is of
Wenn du alle anderen < 9 auch abfängst, dann kannst du einfach else benutzen.
Delphi-Quellcode:
case x of
case 1: ; case 2: ; case 3,4,5: ; case 6: ; case 7: ; case 8: ; case 9: ; else ; end; |
AW: Case Is of
Zitat:
Delphi-Quellcode:
Meine Idee war es das in einer Case Anweisung zu verwirklichen.
procedure TSkinMediaTimer.UpdateDis(WinHandle: HWND; DC: HDC; ViewTime: Integer);
var DisplayMin: Integer; DisplaySec: Integer; DisplayMs: Integer; NumImg, NumImgW, NumImgH: cardinal; Graphics: Cardinal; begin DisplayMs := ViewTime mod 1000 div 10; DisplaySec := ViewTime div 1000; DisplayMin := DisplaySec div 60; DisplaySec := DisplaySec mod 60; DisplayMin := DisplayMin mod 60; NumImg := SkinEngine.GetProperty(WinHandle, NUMBER_IMAGE); if GdipCreateFromHDC(DC, Graphics) = 0 then begin SkinEngine.GetImageSize(NumImg, NumImgW, NumImgH); case DisplayMin of 9: begin NumberLed(Graphics, NumImgH, 1, StrToInt(Copy(IntToStr(DisplayMin), 1, 1))); NumberLed(Graphics, NumImgH, 2, StrToInt(Copy(IntToStr(DisplayMin), 2, 1))); end; 0: begin NumberLed(Graphics, NumImgH, 1, 0); NumberLed(Graphics, NumImgH, 2, 0); end else begin NumberLed(Graphics, NumImgH, 1, 0); NumberLed(Graphics, NumImgH, 2, StrToInt(Copy(IntToStr(DisplayMin), 1, 1))); end; end; case DisplaySec of 9: begin NumberLed(Graphics, NumImgH, 3, StrToInt(Copy(IntToStr(DisplaySec), 1, 1))); NumberLed(Graphics, NumImgH, 4, StrToInt(Copy(IntToStr(DisplaySec), 2, 1))); end; 0: begin NumberLed(Graphics, NumImgH, 3, 0); NumberLed(Graphics, NumImgH, 4, 0); end; else begin NumberLed(Graphics, NumImgH, 3, 0); NumberLed(Graphics, NumImgH, 4, StrToInt(Copy(IntToStr(DisplaySec), 1, 1))); end; end; case DisplayMs of 9: begin NumberLed(Graphics, NumImgH, 5, StrToInt(Copy(IntToStr(DisplayMs), 1, 1))); NumberLed(Graphics, NumImgH, 6, StrToInt(Copy(IntToStr(DisplayMs), 2, 1))); end; 0: begin NumberLed(Graphics, NumImgH, 5, 0); NumberLed(Graphics, NumImgH, 6, 0); end else begin NumberLed(Graphics, NumImgH, 5, 0); NumberLed(Graphics, NumImgH, 6, StrToInt(Copy(IntToStr(DisplayMs), 1, 1))); end; end; GdipDeleteGraphics(Graphics); end; end; Scheint aber nicht so zu funktionieren wie gedacht OHNE If abfrage. bei 9: sollte eigentlich "> 9" stehen .. hmm scheint wohl nicht zu funktionieren. gruss |
AW: Case Is of
probier mal
Delphi-Quellcode:
9..MaxInt: ...
|
AW: Case Is of
Zitat:
Danke. Sorry muss mich erst wieder nach meiner Krankheit erholen. (Fangen) gruss |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:20 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