Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   case (https://www.delphipraxis.net/11675-case.html)

Hansa 12. Nov 2003 11:09

Re: case
 
Zitat:

Zitat von choose
Delphi-Quellcode:
case foo of
  23: //..
  42: if Bar then SomeAction;  <--- ; hat mit else nichts zu tun
      else AnotherAction       <--- "CASE-else"
end;                           <--- "CASE-end"

ich schreibe das immer so:

Delphi-Quellcode:
case foo of
  23: //..
  42: if Bar then SomeAction;  <--- ; hat mit else nichts zu tun
  else
    AnotherAction      
end;

Killer 12. Nov 2003 12:15

Re: case
 
Danke Jungs ihr habt mir sehr geholfen :)

[edit=Sharky]Doppelposting gelöscht. Mfg, Sharky[/edit]

Robert Marquardt 12. Nov 2003 14:36

Re: case
 
Hansa, das Problem mit dem Code ist das er je nachdem ob da ein ";" steht oder nicht unterschiedliche Bedeutung bekommt.

Hansa 12. Nov 2003 17:55

Re: case
 
Zitat:

Zitat von Robert Marquardt
...je nachdem ob da ein ";" steht oder nicht unterschiedliche Bedeutung bekommt.

Die Syntax muß doch ein deutig sein, oder nicht ? Zumindest im Kontext. Also vor ELSE kein Strichpunkt, es sei denn vorher steht ein CASE. Mit doppeldeutigen Möglichkeiten ließe sich kein Compiler bauen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:23 Uhr.
Seite 2 von 2     12   

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