AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Konstantenausdruck erwartet

Ein Thema von aerotech · begonnen am 27. Jun 2004 · letzter Beitrag vom 27. Jun 2004
Antwort Antwort
aerotech

Registriert seit: 27. Mai 2004
124 Beiträge
 
#1

Konstantenausdruck erwartet

  Alt 27. Jun 2004, 14:44
Delphi-Quellcode:
procedure Stufen;
begin

  count:= count +1;

  with Form1 do begin
    case count of

     1: begin
     Lb_Stufe1.Font.color := clred;
     Lb_Stufe15.Font.color := clWhite;
     end;

     2: begin
     Lb_Stufe2.Font.color := clred;
     Lb_Stufe1.Font.color := clWhite;
     end;

     3: begin
     Lb_Stufe3.Font.color := clred;
     Lb_Stufe2.Font.color := clWhite;
     end;

     4: begin
     Lb_Stufe4.Font.color := clred;
     Lb_Stufe3.Font.color := clWhite;
     end;

     5: begin
     Lb_Stufe5.Font.color := clred;
     Lb_Stufe4.Font.color := clWhite;
     end;

     6: begin
     Lb_Stufe6.Font.color := clred;
     Lb_Stufe5.Font.color := clWhite;
     end;

     7: begin
     Lb_Stufe7.Font.color := clred;
     Lb_Stufe6.Font.color := clWhite;
     end;

     8: begin
     Lb_Stufe8.Font.color := clred;
     Lb_Stufe7.Font.color := clWhite;
     end;

     9: begin
     Lb_Stufe9.Font.color := clred;
     Lb_Stufe8.Font.color := clWhite;
     end;

     10: begin
     Lb_Stufe10.Font.color := clred;
     Lb_Stufe9.Font.color := clWhite;
     end;

     11: begin
     Lb_Stufe11.Font.color := clred;
     Lb_Stufe10.Font.color := clWhite;
     end;

     12: begin
     Lb_Stufe12.Font.color := clred;
     Lb_Stufe11.Font.color := clWhite;
     end;

     13: begin
     Lb_Stufe13.Font.color := clred;
     Lb_Stufe12.Font.color := clWhite;
     end;

     14: begin
     Lb_Stufe14.Font.color := clred;
     Lb_Stufe13.Font.color := clWhite;
     end;

     15: begin
     Lb_Stufe15.Font.color := clred;
     Lb_Stufe14.Font.color := clWhite;
     end;

       if count = 15 then begin

       Frage1.Visible := false;
       Frage2.Visible := false;
       Frage3.Visible := false;
       Frage4.Visible := false;
       end;

    end;
  end;
end;
beim end unter der if anweisung kommt -> [Fehler] Unit1.pas(184): Konstantenausdruck erwartet

ich hab mal end; weggenommen, welche hinzugefügt, aber nix passiert...immer die meldung (s.o)
  Mit Zitat antworten Zitat
Benutzerbild von Matze
Matze
(Co-Admin)

Registriert seit: 7. Jul 2003
Ort: Schwabenländle
14.929 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: Konstantenausdruck erwartet

  Alt 27. Jun 2004, 14:47
Schreib mal anstatt:
Delphi-Quellcode:
15: begin
     Lb_Stufe15.Font.color := clred;
     Lb_Stufe14.Font.color := clWhite;
     end;

       if count = 15 then begin

       Frage1.Visible := false;
       Frage2.Visible := false;
       Frage3.Visible := false;
       Frage4.Visible := false;
       end;

    end;
  end;
end;
folgendes:

Delphi-Quellcode:
15: begin
     Lb_Stufe15.Font.color := clred;
     Lb_Stufe14.Font.color := clWhite;
     end;
   end;

       if count = 15 then begin

       Frage1.Visible := false;
       Frage2.Visible := false;
       Frage3.Visible := false;
       Frage4.Visible := false;
       end;
  end;
end;
Ungetestet.
  Mit Zitat antworten Zitat
Benutzerbild von Nikolas
Nikolas

Registriert seit: 28. Jul 2003
1.528 Beiträge
 
Delphi 2005 Personal
 
#3

Re: Konstantenausdruck erwartet

  Alt 27. Jun 2004, 14:57
Was hast du denn gegen die Findcomponent-Lösung
Erwarte das Beste und bereite dich auf das Schlimmste vor.
  Mit Zitat antworten Zitat
Benutzerbild von glkgereon
glkgereon

Registriert seit: 16. Mär 2004
2.287 Beiträge
 
#4

Re: Konstantenausdruck erwartet

  Alt 27. Jun 2004, 21:06
ausser dem hast du da irgendwie:

Delphi-Quellcode:
case count of
...usw...
     15: begin
     Lb_Stufe15.Font.color := clred;
     Lb_Stufe14.Font.color := clWhite;
     end;

       if count = 15 then begin

       Frage1.Visible := false;
       Frage2.Visible := false;
       Frage3.Visible := false;
       Frage4.Visible := false;
       end;
mach doch so:

Delphi-Quellcode:
case count of
...usw...
     15: begin
     Lb_Stufe15.Font.color := clred;
     Lb_Stufe14.Font.color := clWhite;
     Frage1.Visible := false;
     Frage2.Visible := false;
     Frage3.Visible := false;
     Frage4.Visible := false;
     end;
oder wo ist der unterschied?
»Unlösbare Probleme sind in der Regel schwierig...«
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:36 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