Thema: Delphi if-then-else

Einzelnen Beitrag anzeigen

LoL
(Gast)

n/a Beiträge
 
#1

if-then-else

  Alt 4. Okt 2004, 09:33
hallo zusammen,

warum bricht die abfrage bei diesem code ab wenn ein edit feld nich enabled ist
Delphi-Quellcode:
  if edit1.Enabled then
    if edit1.Text = 'then edit1.SetFocus
  else if edit2.Enabled then
    if edit2.Text = 'then edit2.SetFocus
  else if edit3.Enabled then
    if edit3.Text = 'then edit3.SetFocus
und bei der nicht? es müsste doch trotzdem der else teil ausgeführt werden!

Delphi-Quellcode:
  if (edit1.Enabled) and (edit1.Text = '') then edit1.SetFocus
  else if (edit2.Enabled) and (edit2.Text = '') then edit2.SetFocus
  else if (edit3.Enabled) and (edit3.Text = '') then edit3.SetFocus
  Mit Zitat antworten Zitat