Einzelnen Beitrag anzeigen

Benutzerbild von Fussel9
Fussel9

Registriert seit: 25. Mai 2009
322 Beiträge
 
Turbo Delphi für Win32
 
#32

Re: problem beim vergleichen von Karten --- Gewinner ermitte

  Alt 31. Jan 2010, 16:10
wieso geht das nochmal nicht? Hatte den fehler glaub ich schonmal... aber weiß es nicht mehr das ist meine zweite Form ... der ''Debuger''

Delphi-Quellcode:
unit UDeb;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, UKartenliste, UKarte;

type
  TFDeb = class(TForm)
    MKartenliste: TMemo;
    MHandListen: TMemo;
    MProtokoll: TMemo;
    procedure FormCreate(Kliste,Hand,G1Hand,G2Hand: TKartenliste; Sender: TObject);
  private
    {LT}
  public
    procedure updateview(Kliste,Hand,G1Hand,G2Hand: TKartenliste);
  end;

var
  FDeb: TFDeb;

implementation

{$R *.dfm}

procedure TFDeb.FormCreate(Kliste,Hand,G1Hand,G2Hand: TKartenliste; Sender: TObject);
begin
  updateview(Kliste,Hand,G2Hand,G2Hand);
end;

procedure TFDeb.updateview(Kliste,Hand,G1Hand,G2Hand: TKartenliste);
Var Hilf,HandHilf,G1Hilf,G2Hilf: TKarte;
begin
hilf:=TKarte.create(nil);
HandHilf:=TKarte.create(nil);
G1Hilf:=TKarte.create(nil);
G2Hilf:=TKarte.create(nil);
MessageDLG('Der Debuger wird erneuert!',mtWarning,[mbYes],0);
hilf:=Kliste.GibAktuelles;
Kliste.toFirst;
MKartenliste.Lines.Add('## Karten: ##');
while not (Kliste.GibAktuelles = Kliste.GibLetztes) do
  begin
    if (Kliste.GibAktuelles = hilf) then
      begin
        MKartenliste.Lines.add(IntToStr(Kliste.GibAktuelles.GibInhalt.GibZahl)+' '
                          +Kliste.GibAktuelles.GibInhalt.GibFarbe+' '
                          +Kliste.GibAktuelles.GibInhalt.GibPfad+'<--');
      end
    else
      begin
        MKartenliste.Lines.add(IntToStr(Kliste.GibAktuelles.GibInhalt.GibZahl)+' '
                          +Kliste.GibAktuelles.GibInhalt.GibFarbe+' '
                          +Kliste.GibAktuelles.GibInhalt.GibPfad);
      end;
    Kliste.Next;
  end;
HandHilf:=Hand.GibAktuelles;
Hand.toFirst;
G1Hilf:=G1Hand.GibAktuelles;
G1Hand.toFirst;
G2Hilf:=G2Hand.GibAktuelles;
G2Hand.toFirst;
MHandListen.Lines.Add('## HAND: ##');
while not (Hand.GibAktuelles = Hand.GibLetztes) do
  begin
    if (Hand.GibAktuelles = HandHilf) then
      begin
        MHandListen.Lines.add(IntToStr(Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +Hand.GibAktuelles.GibInhalt.GibPfad+'<--');
      end
    else
      begin
        MHandListen.Lines.add(IntToStr(Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +Hand.GibAktuelles.GibInhalt.GibPfad);

      end;
    Hand.Next;
  end;
MHandListen.Lines.Add('## G1HAND: ##');
while not (G1Hand.GibAktuelles = G1Hand.GibLetztes) do
  begin
    if (G1Hand.GibAktuelles = G1Hilf) then
      begin
        MHandListen.Lines.add(IntToStr(G1Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +G1Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +G1Hand.GibAktuelles.GibInhalt.GibPfad+'<--');
      end
    else
      begin
        MHandListen.Lines.add(IntToStr(G1Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +G1Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +G1Hand.GibAktuelles.GibInhalt.GibPfad);

      end;
    G1Hand.Next;
  end;
MHandListen.Lines.Add('## G2HAND: ##');
while not (G2Hand.GibAktuelles = G2Hand.GibLetztes) do
  begin
    if (G2Hand.GibAktuelles = G2Hilf) then
      begin
        MHandListen.Lines.add(IntToStr(G2Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +G2Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +G2Hand.GibAktuelles.GibInhalt.GibPfad+'<--');
      end
    else
      begin
        MHandListen.Lines.add(IntToStr(G2Hand.GibAktuelles.GibInhalt.GibZahl)+' '
                              +G2Hand.GibAktuelles.GibInhalt.GibFarbe+' '
                              +G2Hand.GibAktuelles.GibInhalt.GibPfad);

      end;
    G2Hand.Next;
  end;
Kliste.SetzeAktuelles(Hilf);
Hand.SetzeAktuelles(HandHilf);
G1Hand.SetzeAktuelles(G1Hilf);
G2Hand.SetzeAktuelles(G2Hilf);
end;

end.
@Freak4Fun...ich gucks mir mal an... is nur im moment schlecht...wegen der AccesViolation oben fliegt mir gerade das ganze programm um die ohren^^


der fliegt bei hilf:=Kliste.GibAktuelles; raus...


€dit:

Anhang
  Mit Zitat antworten Zitat