Autor Beitrag
Dia
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Di 06.11.07 20:37 
Hi,

hab ein kleines Problem mit meiner else-Anweisung. Die Struktur ist folgende

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if ... then
  begin
    .. 
    case .. of
    ...
    ...
    end
  else  <- das soll sich auf if ... then beziehen 
  ...
end;


Mein Problem ist, dass Delphi immer mekert, dass kein end for else stehen darf. Das ist mir ja auch klar, wenn es sich auf case .. of beziehen würde. Was es ja aber nicht tut.

Wie sage ich jetzt Delphi, dass else zum if gehört?

Danke
Jann1k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 866
Erhaltene Danke: 43

Win 7
TurboDelphi, Visual Studio 2010
BeitragVerfasst: Di 06.11.07 20:39 
hinter eine case anweisung gehört immer ein eigenes end

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
1: 
 if ... then  
  begin  
    ..   
    case .. of  
    ...  
    ...  
    end;  //case
  end  //if then else
  else 
  ...  
end;
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 06.11.07 20:40 
Das gilt aber nur für das Else des Case (ehemals otherwise)

_________________
Markus Kinzler.
Dia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Di 06.11.07 20:44 
Danke,

hat geklappt.