Thema: Debugging

Einzelnen Beitrag anzeigen

Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#7

Re: Debugging

  Alt 25. Jul 2006, 21:27
Das ist der Code von DOND
Es hängt übrigends nicht von der Prozedur & Zeile ab

Delphi-Quellcode:
procedure TForm1.SpeedButton52Click(Sender: TObject);
var
  sb: TSpeedButton;
  i: Integer;
  sum, f: Extended;
begin
  PlaySoundNew('SND_CLICK', SND_RESOURCE or SND_ASYNC);
  sb:=TSpeedButton(Sender);
  sb.Enabled:=False;
  if Label2.Caption='-then begin
    Label2.Caption:=IntToStr(sb.Tag);
    KofferWert := Money[MoneyBag[sb.Tag]];
    GroupBox8.Visible:=False;
    GroupBox7.Visible:=True;
  end else begin
    TSpeedButton(FindComponent('SpeedButton'+IntToStr(MoneyBag[sb.Tag]))).Enabled:=False;
    Label7.Caption := FloatToStr(Money[MoneyBag[sb.Tag]]) + '';
    Label7.Visible := true;
    Application.ProcessMessages;
    sleep(500);
    Label7.Visible := false;
    if MoneyBag[sb.Tag]=26 then
      PlaySoundNew('SND_ARGH', SND_RESOURCE or SND_SYNC);
    if BagCount = 1 then begin
      if not DummyRound then begin
        Form2.NewScore := KofferWert;
        Form2.ShowModal;
      end;
      GroupBox7.Visible:=False;
      GroupBox5.Visible:=True;
    end else
      if not DummyRound and ((BagCount=20) or (BagCount=15) or (BagCount=11) or (BagCount=8) or (BagCount<=6)) then begin
        GroupBox4.Enabled:=False;
        GroupBox7.Visible:=False;
        GroupBox6.Visible:=True;
        PlaySoundNew('SND_RINGIN', SND_RESOURCE or SND_ASYNC);
        sum:=0;
        for i:=1 to 26 do
          if TSpeedButton(FindComponent('SpeedButton'+IntToStr(i))).Enabled then
            sum := sum + MONEY[i];

        f:=1;
        case BagCount of
          20: f:=6.0;
          15: f:=4.5;
          11: f:=3.5;
           8: f:=2.5;
           6: f:=2.0;
           5: f:=1.8;
           4: f:=1.6;
           3: f:=1.3;
        end;
        BankAngebot := Round(sum / (BagCount*f));
// if BankAngebot > 100 then
// BankAngebot := BankAngebot div 100 * 100;
        Label1.Caption := FloatToStr(BankAngebot);
      end;
  end;
end;
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat