Thema: Delphi boolean ohne variable?

Einzelnen Beitrag anzeigen

NicoDE
(Gast)

n/a Beiträge
 
#24

Re: boolean ohne variable?

  Alt 15. Dez 2004, 20:52
Zitat von glkgereon:
nochmal ne frage...also so:

Delphi-Quellcode:
type
  TTest = record
    Variable:Typ;
    case Typ of //bezieht sich auf die zuletzt genannte Variable des Typs 'Typ'
      Wert1: (a:Typa, b:Typb);//Fall 1
      Wert2: (x:Typx, y:Typy);//Fall 2
  end;
ist das so korrekt?
mit kommentaren, ends und allem?
Fast, Semikolon statt Kommata:
Delphi-Quellcode:
type
  TTest = record
    case Variable: Typ of // Gleich hier, statt davor (verdeutlicht besser die Bedeutung von 'Variable')
      Wert1: (
        a: Typa; // Semilkolon
        b: Typb);
      Wert2: (
        x: Typx;
        y: Typy);
  { end; }  // unnötig, da variante Member ohnehin nur am Ende erlaubt
  end;
  Mit Zitat antworten Zitat