Autor Beitrag
Black200607
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 50

Win XP
Pascal(Free Pascal/Lazarus), Java, Php, Python
BeitragVerfasst: Fr 22.12.06 13:54 
Ich habe ein Programm geschrieben und wollte fragen, warum dass nit klappt:
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:
unit Deck1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, XPMan, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit59: TEdit;
    Edit60: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Edit9: TEdit;
    Edit10: TEdit;
    Edit11: TEdit;
    Edit12: TEdit;
    Edit13: TEdit;
    Edit14: TEdit;
    Edit15: TEdit;
    Edit16: TEdit;
    Edit17: TEdit;
    Edit18: TEdit;
    Edit19: TEdit;
    Edit20: TEdit;
    Edit21: TEdit;
    Edit22: TEdit;
    Edit23: TEdit;
    Edit24: TEdit;
    Edit25: TEdit;
    Edit26: TEdit;
    Edit27: TEdit;
    Edit28: TEdit;
    Edit29: TEdit;
    Edit30: TEdit;
    Edit31: TEdit;
    Edit32: TEdit;
    Edit33: TEdit;
    Edit34: TEdit;
    Edit35: TEdit;
    Edit36: TEdit;
    Edit37: TEdit;
    Edit38: TEdit;
    Edit39: TEdit;
    Edit40: TEdit;
    Edit41: TEdit;
    Edit42: TEdit;
    Edit43: TEdit;
    Edit44: TEdit;
    Edit45: TEdit;
    Edit46: TEdit;
    Edit47: TEdit;
    Edit48: TEdit;
    Edit49: TEdit;
    Edit50: TEdit;
    Edit51: TEdit;
    Edit52: TEdit;
    Edit53: TEdit;
    Edit54: TEdit;
    Edit55: TEdit;
    Edit56: TEdit;
    Edit57: TEdit;
    Edit58: TEdit;
    MainMenu1: TMainMenu;
    XPManifest1: TXPManifest;
    OpenDialog1: TOpenDialog;
    SaveDialog1: TSaveDialog;
    Datei1: TMenuItem;
    ffnen1: TMenuItem;
    Speichern1: TMenuItem;
    procedure ffnen1Click(Sender: TObject);
    procedure Speichern1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  Tsl: Tstringlist;
  Name: String;
implementation

{$R *.dfm}

procedure TForm1.ffnen1Click(Sender: TObject);
var Cb: Integer;
begin
Opendialog1.Execute;
Tsl := TStringList.Create;


  while cb <= 60 do
  begin
    Tsl.Add(TEdit(FindComponent('Edit' + IntToStr(cb))).Text);

   Tsl.loadfromFile(Name + '.txt');
   end;

end;

procedure TForm1.Speichern1Click(Sender: TObject);
var b: Integer;
begin
Savedialog1.execute;
Tsl := TStringList.Create;


while b <= 60 do
begin
    Tsl.Add(TEdit(FindComponent('Edit' + IntToStr(b))).Text);
Tsl.SaveToFile(Name);
tsl.Free;
end;
end;

end.


Hoffe auf schnelle Hilfe.

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


Zuletzt bearbeitet von Black200607 am Fr 22.12.06 19:31, insgesamt 1-mal bearbeitet
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 22.12.06 13:58 
Titel: Re: Wieso klappt dass nicht?
user profile iconBlack200607 hat folgendes geschrieben:
warum dass nit klappt:

Du musst schon etwas mehr schreiben als nur "es klappt nicht, warum?" damit wir dir helfen können. Was genau klappt oder funktioniert denn nicht?

Außerdem ändere bitte den Titel des Topics, da er wenig über das eigentlich Thema verrät.

Gruß
Tino
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 22.12.06 13:59 
Ein Fehler is sschonmal, dass beim speichern b einen zufälligen startwert hat.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 22.12.06 14:05 
Ja klar hat 'b' einen zufälligen Startwert. Du musst die Startwerte schon explizit angeben.

_________________
Na denn, dann. Bis dann, denn.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 22.12.06 14:13 
Und bei cb beim öffnen isses das gleiche.
Und die Werte werden nich hochgezählt :arrow: Endlosschleife

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Black200607 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 50

Win XP
Pascal(Free Pascal/Lazarus), Java, Php, Python
BeitragVerfasst: Fr 22.12.06 17:14 
Das mit dem speichern und laden funktioniert nicht. Ich habe den Variablen b und cb jetzt auch den Startwert 0 gegeben und sie in der Schleife hochzählen lassen.
Trotzdem kommt beim speichern diese Meldung:

Zugriffsverletzung bei Adresse 00000001. Lesen von Adresse 00000001. :bawling:
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Fr 22.12.06 17:18 
Ohne jetzt gross drüber gekuckt zu haben: Beim Speichern gibst du TS1 in der While-Schleife frei. Das soll doch wohl erst danach freigegeben werden, gell?

Cu,
Udontknow
Black200607 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 50

Win XP
Pascal(Free Pascal/Lazarus), Java, Php, Python
BeitragVerfasst: Fr 22.12.06 17:24 
Das speichern scheint jetzt zu klappen (ich habe tsl.free jetzt hinter die Schleife gestellt), aber jetzt läd er nicht!
Black200607 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 50

Win XP
Pascal(Free Pascal/Lazarus), Java, Php, Python
BeitragVerfasst: Fr 22.12.06 18:31 
Ich habe das Problem gelöst.
Einfach so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
{...}
Tsl.Savetofile (Savedialog1.Filename);
{...}
Tsl.Loadfromfile (Opendialog1.Filename);
{...}
End.

Danke für die Hilfen!
:dance: :dance:

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Fr 22.12.06 18:52 
Du wurdest von Tino gebeten, den Titel Deines Threads zu ändern! Bitte hole das noch nach.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Black200607 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 50

Win XP
Pascal(Free Pascal/Lazarus), Java, Php, Python
BeitragVerfasst: Fr 22.12.06 19:13 
Wie verändert man denn den Titel?
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Fr 22.12.06 19:31 
Einfach oben bei Deinem ersten Beitrag auf user defined image klicken. Danke Dir! :)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".