AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Befehl kürzen

Ein Thema von R34DM3 · begonnen am 10. Feb 2008 · letzter Beitrag vom 12. Feb 2008
 
omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#5

Re: Befehl kürzen

  Alt 10. Feb 2008, 20:45
Wenn man sich mal die Mühe macht und diese Textwüste ordentlich einrückt...

Delphi-Quellcode:
if (gb19.Caption = Fahrzeug1.fkennung)
   and ( (btbg19.Caption <> '4')
        or (falscherstatus = false)
        or (btbg19.Caption <> '6')
        or (btbg19.Caption <> '7')
        or (btbg19.Caption <> '8')
        or (btbg19.Caption <> '3') ) then
begin
  btbg19.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg19.Caption = '1') or (btbg19.Caption = '2') or (btbg19.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb19.Caption = Fahrzeug2.fkennung)
   and ( (btbg19.Caption <> '4')
        or (falscherstatus = false)
        or (btbg19.Caption <> '6')
        or (btbg19.Caption <> '7')
        or (btbg19.Caption <> '8')
        or (btbg19.Caption <> '3') ) then
begin
  btbg19.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg19.Caption = '1') or (btbg19.Caption = '2') or (btbg19.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb19.Caption = Fahrzeug3.fkennung)
   and ( (btbg19.Caption <> '4')
        or (falscherstatus = false)
        or (btbg19.Caption <> '6')
        or (btbg19.Caption <> '7')
        or (btbg19.Caption <> '8')
        or (btbg19.Caption <> '3') ) then
begin
  btbg19.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg19.Caption = '1') or (btbg19.Caption = '2') or (btbg19.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb19.Caption = Fahrzeug4.fkennung)
   and ( (btbg19.Caption <> '4')
        or (falscherstatus = false)
        or (btbg19.Caption <> '6')
        or (btbg19.Caption <> '7')
        or (btbg19.Caption <> '8')
        or (btbg19.Caption <> '3') ) then
begin
  btbg19.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg19.Caption = '1') or (btbg19.Caption = '2') or (btbg19.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb20.Caption = Fahrzeug1.fkennung)
   and ( (btbg20.Caption <> '4')
        or (falscherstatus = false)
        or (btbg20.Caption <> '6')
        or (btbg20.Caption <> '7')
        or (btbg20.Caption <> '8')
        or (btbg20.Caption <> '3') ) then
begin
  btbg20.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb20.Caption = Fahrzeug2.fkennung)
   and ( (btbg20.Caption <> '4')
        or (falscherstatus = false)
        or (btbg20.Caption <> '6')
        or (btbg20.Caption <> '7')
        or (btbg20.Caption <> '8')
        or (btbg20.Caption <> '3') ) then
begin
  btbg20.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb20.Caption = Fahrzeug3.fkennung)
    and ( (btbg20.Caption <> '4')
         or (falscherstatus = false)
         or (btbg20.Caption <> '6')
         or (btbg20.Caption <> '7')
         or (btbg20.Caption <> '8')
         or (btbg20.Caption <> '3') ) then
begin
  btbg20.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5') then
begin
  falscherstatus := true;
end;

if (gb20.Caption = Fahrzeug4.fkennung)
   and ( (btbg20.Caption <> '4')
        or (falscherstatus = false)
        or (btbg20.Caption <> '6')
        or (btbg20.Caption <> '7')
        or (btbg20.Caption <> '8')
        or (btbg20.Caption <> '3') ) then
begin
  btbg20.Caption := '3';
end
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5') then
begin
  falscherstatus := true;
end;
dann kann man vielleicht schon mehr erkennen.
Allerdings nur vielleicht, in Wirklichkeit wird einem dann erst das ganze schreckliche Ausmaß klar und man sollte sich diesem Code vermutlich doch nicht weiter annähren als, naja, sagen wir mal 1km.

Was mich besonders stutzig macht, sind diese komischen...
Delphi-Quellcode:
else if (gb20.Caption = Fahrzeug4.fkennung)
        and (btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5') then
AND- und OR-Verknüpfungen. Fehlt da nicht eventuell noch ein Klammerpaar?

Also so...
Delphi-Quellcode:
else if (gb20.Caption = Fahrzeug4.fkennung)
        and ((btbg20.Caption = '1') or (btbg20.Caption = '2') or (btbg20.Caption = '5')) then
?

Ich sehe da noch viel mehr Problemstellen, lass es aber jetzt mal dabei.
Sorry, aber da vergeht einem ja echt jeglicher Spass am Programmieren.

Traurige Grüsse
Thorsten
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:04 Uhr.
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