Autor Beitrag
joker36
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Mo 22.09.08 17:34 
Habe noch ein Problem und wieder mal keine Durchblick aber einen guten Ansatz ;)

Also, wir sollen jeweils 2 8Stellige Dualzahlen Addieren, nur das Programm will nicht wie ich.
z.Z. sieht meine Berechnung so aus:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
 Bit[0] := StrToInt(Spinedit8.Text);
   Bit[1] := StrToInt(Spinedit7.Text);
   Bit[2] := StrToInt(Spinedit6.Text);
   Bit[3] := StrToInt(Spinedit5.Text);
   Bit[4] := StrToInt(Spinedit4.Text);
   Bit[5] := StrToInt(Spinedit3.Text);
   Bit[6] := StrToInt(Spinedit2.Text);
   Bit[7] := StrToInt(Spinedit1.Text);

   Bit[8] := StrToInt(Spinedit16.Text);
   Bit[9] := StrToInt(Spinedit15.Text);
   Bit[10] := StrToInt(Spinedit14.Text);
   Bit[11] := StrToInt(Spinedit13.Text);
   Bit[12] := StrToInt(Spinedit12.Text);
   Bit[13] := StrToInt(Spinedit11.Text);
   Bit[14] := StrToInt(Spinedit10.Text);
   Bit[15] := StrToInt(Spinedit9.Text);

   for i:=0 to 7 do
   BEGIN
   tmp:= bit[i]+bit[i+8];
   tmpb:= StrToInt(edid[q].Text);
        If tmp=2 then
                Begin
                        IF tmpb=0 then
                        Begin
                                tmpa:=1;
                                tmpb:=2;

                                edid[q].text:=IntToStr(tmpa); {übertrag}
                                q:=q+1;

                                w:=w+1;
                                edid[w].text:=IntToStr(tmpa); {ergebnis}
                                w:=w+1;
                        END
                                ELSE
                        IF tmpb=2 then
                        Begin
                                tmpa:=1;

                                edid[q].text:=IntToStr(tmpa); {übertrag}
                                q:=q+1;
                                w:=w-1;
                                edid[w].text:=IntToStr(0);
                                w:=w+1;
                                edid[w].text:=IntToStr(tmpa); {ergebnis}
                                w:=w+1;
                        END

                END
        Else
                If tmp=1 then
                BEGIN
                tmpa:=1;
                edid[w].text:=IntToStr(tmpa);
                w:=w+1;
                END
        Else
                If tmp=0 then
                BEGIN
                TMPa:=0;
                edid[w].text:=IntToStr(tmpa);
                w:=w+1;
                END


Ich kriege einfach die Berechnung nicht hin in dem das Programm den Übertrag mit rein nimmt.

Moderiert von user profile iconGausi: Quote- durch Delphi-Tags ersetzt