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
Antwort Antwort
omata

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

Re: Befehl kürzen

  Alt 10. Feb 2008, 21:22
Hier doch nochmal ein Vorschlag...

Delphi-Quellcode:
type
  TMyResult = (_None, _True, _False);

function Test(FahrzeugkennungA, FahrzeugkennungB,
              CaptionA, CaptionB, CaptionC:string;
              falscherstatus:boolean):TMyResult;
begin
  Result:=_None;
  if (CaptionA = FahrzeugkennungA)
     and ( (CaptionB <> '4')
          or (CaptionB <> '6')
          or (CaptionB <> '7')
          or (CaptionB <> '8')
          or (CaptionB <> '3')
          or not falscherstatus) then
  begin
    Result:=_True;
  end
  else if (CaptionC = FahrzeugkennungB)
          and ((CaptionA = '1') or (CaptionA = '2') or (CaptionA = '5')) then
  begin
    Result:=_False;
  end;
end;

procedure TForm.Proc(var status:boolean);
var F4K, CapA, CapC:string;
begin
  F4K:=Fahrzeug4.fkennung;
  CapA:=gb19.Caption;
  CapC:=gb20.Caption;
  case Test(Fahrzeug1.fkennung, F4K, CapA, btbg19.Caption, CapC, status) of
    _True: btbg19.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug2.fkennung, F4K, CapA, btbg19.Caption, CapC, status) of
    _True: btbg19.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug3.fkennung, F4K, CapA, btbg19.Caption, CapC, status) of
    _True: btbg19.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug4.fkennung, F4K, CapA, btbg19.Caption, CapC, status) of
    _True: btbg19.Caption:='3';
    _False: status:=true;
  end;

  CapA:=gb20.Caption;
  CapC:=gb20.Caption;
  case Test(Fahrzeug1.fkennung, F4K, CapA, btbg20.Caption, CapC, status) of
    _True: btbg20.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug2.fkennung, F4K, CapA, btbg20.Caption, CapC, status) of
    _True: btbg20.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug3.fkennung, F4K, CapA, btbg20.Caption, CapC, status) of
    _True: btbg20.Caption:='3';
    _False: status:=true;
  end;
  case Test(Fahrzeug4.fkennung, F4K, CapA, btbg20.Caption, CapC, status) of
    _True: btbg20.Caption:='3';
    _False: status:=true;
  end;
end;
Nicht schön, aber selten...
  Mit Zitat antworten Zitat
Antwort Antwort


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 22:36 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