Autor Beitrag
Naemo
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Do 01.03.07 19:35 
Hi!
Ich hatte es mit einem kumpel geschafft mit 100 edits(-.-) eine hundertertafel zu machen
bei der eben 25 kästchen zu einem '?' werden
und wollen nun aus dieser eine tausendertafel machen ... und haben uns gedacht wenn man
nun einfach die anfangs zahl also random(900) definiert und diese variable eben bis x+100
laufen lassen wäre alles gemacht aber nuja sobald wir das ändern und dann beim run auf
den buttom clicken um die tafel zu erstellen kommt "Debugger Exception Notification" und
dann geht nix mehr :(

naja könntet ihr mal schaun wie ich daraus eine 1000er tafel mache?

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:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
procedure TForm3.Button2Click(Sender: TObject);
var
          p: Integer;
          i: array[1..100] of string;
     k,t, z, u : integer;
  SchonGehabt: array [1..100] of Boolean;

  begin
  butclic := true;                         //fürn Timer
  Z:= 60 ;

      begin

begin
k:=0;
repeat
k:=k+1;
i[k]:=inttostr(k);
until k =100;

p:=0;

repeat
p:= p+1;
schongehabt[p] := true;
until p=100;

u:=0;
repeat
u:=u+1;
k:=random(101);
if schongehabt[k] = true then
Begin
schongehabt[k]:= false;
i[k]:='?';
End
else
Begin
u:=u-1;
End
until u=25;
t := random(900);

Edit1.text:=i[1];
Edit2.text:=i[2];
Edit3.text:=i[3];
Edit4.text:=i[4];
Edit5.text:=i[5];
Edit6.text:=i[6];
Edit7.text:=i[7];
Edit8.text:=i[8];
Edit9.text:=i[9];
Edit10.text:=i[10];
Edit11.text:=i[11];
Edit12.text:=i[12];
Edit13.text:=i[13];
Edit14.text:=i[14];
Edit15.text:=i[15];
Edit16.text:=i[16];
Edit17.text:=i[17];
Edit18.text:=i[18];
Edit19.text:=i[19];
Edit20.text:=i[20];
Edit21.text:=i[21];
Edit22.text:=i[22];
Edit23.text:=i[23];
Edit24.text:=i[24];
Edit25.text:=i[25];
Edit26.text:=i[26];
Edit27.text:=i[27];
Edit28.text:=i[28];
Edit29.text:=i[29];
Edit30.text:=i[30];
Edit31.text:=i[31];
Edit32.text:=i[32];
Edit33.text:=i[33];
Edit34.text:=i[34];
Edit35.text:=i[35];
Edit36.text:=i[36];
Edit37.text:=i[37];
Edit38.text:=i[38];
Edit39.text:=i[39];
Edit40.text:=i[40];
Edit41.text:=i[41];
Edit42.text:=i[42];
Edit43.text:=i[43];
Edit44.text:=i[44];
Edit45.text:=i[45];
Edit46.text:=i[46];
Edit47.text:=i[47];
Edit48.text:=i[48];
Edit49.text:=i[49];
Edit50.text:=i[50];
Edit51.text:=i[51];
Edit52.text:=i[52];
Edit53.text:=i[53];
Edit54.text:=i[54];
Edit55.text:=i[55];
Edit56.text:=i[56];
Edit57.text:=i[57];
Edit58.text:=i[58];
Edit59.text:=i[59];
Edit60.text:=i[60];
Edit61.text:=i[61];
Edit62.text:=i[62];
Edit63.text:=i[63];
Edit64.text:=i[64];
Edit65.text:=i[65];
Edit66.text:=i[66];
Edit67.text:=i[67];
Edit68.text:=i[68];
Edit69.text:=i[69];
Edit70.text:=i[70];
Edit71.text:=i[71];
Edit72.text:=i[72];
Edit73.text:=i[73];
Edit74.text:=i[74];
Edit75.text:=i[75];
Edit76.text:=i[76];
Edit77.text:=i[77];
Edit78.text:=i[78];
Edit79.text:=i[79];
Edit80.text:=i[80];
Edit81.text:=i[81];
Edit82.text:=i[82];
Edit83.text:=i[83];
Edit84.text:=i[84];
Edit85.text:=i[85];
Edit86.text:=i[86];
Edit87.text:=i[87];
Edit88.text:=i[88];
Edit89.text:=i[89];
Edit90.text:=i[90];
Edit91.text:=i[91];
Edit92.text:=i[92];
Edit93.text:=i[93];
Edit94.text:=i[94];
Edit95.text:=i[95];
Edit96.text:=i[96];
Edit97.text:=i[97];
Edit98.text:=i[98];
Edit99.text:=i[99];
Edit100.text:=i[100];


end;



hätte gedacht
repeat
k:=random(900);
...
k:=k+1;
...
until k:= k+100;

aber nuja klappt leider net :(

MfG Naemo
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Do 01.03.07 19:59 
was ist ne hundertertafel?

was kann man sich darunter vorstellen?

beim überfliegen bin ich übrigens auf das gestoßen, wo du zig mal untereinander einem edit den selben wert zuweist! mach das in ner schleife! das ist wesentlich übersichtlicher!


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  a: integer;
begin
  for a:=0 to ComponentCount-1 do
    if Components[a] is TEdit then
      TEdit(Components[a]).Text:='hallo';


--edit--
formatierung von quelltext is aber och ne dei ding oder? kann man ja ne ma lesen! *ggg*

_________________
Ein Spezialist ist ein Mensch, der immer mehr von immer weniger weis, bis er alles von nichts weis!
Dragonclaw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 196

Windows Vista
Delphi 7 Prof.
BeitragVerfasst: Do 01.03.07 20:06 
Guck dir mal diesen Thread an, da wurde da schon mal besprochen:

www.delphi-forum.de/...&highlight=tafel
Naemo Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Do 01.03.07 20:09 
also hundertertafel ist:
(deute es mal an)

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 ...........
41 ........
51 ......
61 ....
71 ..
81 ..
91 92 93 94 95 96 97 98 99 100

danke für deinen tip
Naemo Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Do 01.03.07 20:34 
ja das war ja auch mein thread
aber mit string grid ahben wir gelassen, da markieren net ging!
deshalb haben wir jetzt edits und das einzige problem was wir nun beheben wollen
ist eben die zufällige auswahl von edits um lücken zu lassen, und so funktioniert
es auch wie shcon dargestellt nur ich schaffe es nicht das dies anstatt von 0 bis 100,
von einer zufälligen zahl (aus 900) und den 100 darauf folgenden ergibt
trotzdem bisher danke
NCortex
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 126

WIN 2000
D7 Enterprise
BeitragVerfasst: Mi 07.03.07 00:14 
also ganz ehrlich...

ich würde die Editfelder zur laufzeit erzeugen. Position bestimmen und mit entsprechendem Inhalt füllen.

Ich wäre niemals auf die Idee gekommen, 100 Edits auf die Form zu ziehen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Edits : array[0..999] of TEdit;

for i := 0 to 999 do 
   begin
     Edits[i] := TEdit.Create();
     Edits[i].parent := Form1;
     Edits[i].top := (i * 20) mod 100;
     Edits[i].Left := (i / 100)*20;
     Edits[i].Text := inttostr(i);
   end;



ausm kopf, so oder so ähnlich gehts...

Moderiert von user profile iconjasocul: Delphi-Tags hinzugefügt

_________________
"...by all means, do not use a hammer." (aus einer IBM Technikerdokumentation ca. 1920)
--->außer es kam von Microsoft<---