Autor Beitrag
Blamaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164



BeitragVerfasst: Sa 17.05.08 23:52 
Hi,

ich habe momentan ein kleines Problem mit dem syntax.

Mal ein Beispiel

If **** Then
begin

If **** Then
begin
************
end
else
************
end;

Würde Delphi hier erkennen, das das else eindeutig zur 1.If Anweisung gehört ?

mfg Blamaster
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 18.05.08 00:05 
Nein, da du ihm was anderes sagst :P. Das würdest du mit etwas sinnvoller Einrückung auch sehen, der deutlichste Vorteil von Code-Formatierung :roll:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
If **** Then
begin
  If **** Then
  begin
    ************
  end
  else
    ************
end;


Umd das else auf das 1. If zu beziehen, müsste das ungefähr so assehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
If **** Then
begin
  If **** Then
  begin
    ************
  end;
end 
else
  ************


HTH, Martok

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."