Autor Beitrag
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Sa 24.04.10 06:48 
Hi :)

Das geht auch nur, wenn die Edit-Felder in einem Array of TEdit sind.

Für FindComponent müsstest du Edit[i] durch TEdit(FindComponent('Edit' + IntToStr(i))) ersetzen.

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)


Zuletzt bearbeitet von Hidden am So 02.05.10 13:03, insgesamt 1-mal bearbeitet
Stread
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Sa 24.04.10 09:15 
Komisch, gestern gings noch. Habs reineditiert aber hier nochmal.

Moderiert von user profile iconNarses: Das Bild ist in diesem Beitrag zu sehen.
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Sa 24.04.10 14:49 
@stread: gute arbeit. aber ich will gern nen ganzen schein abgleichen. bei dir ist ja nur 1 tip abgedeckt. weist wie ich meine ?

mag mal einer schauen woran es bei mir hängt ?
Einloggen, um Attachments anzusehen!
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Sa 24.04.10 20:11 
Wenn du uns sagst, was dein Compiler dir für Meldungen ausgibst, was passiert und was passieren soll ;)

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: So 25.04.10 16:42 
[DCC Fehler] lotto.pas(265): E2003 Undeklarierter Bezeichner: 'Edit'
ausblenden Delphi-Quelltext
1:
aStringList.Append(Edit[i].Text);					


Zitat:
Das geht auch nur, wenn die Edit-Felder in einem Array of TEdit sind.
Für FindComponent müsstest du Edit[i] durch FindComponent('Edit' + IntToStr(i)) ersetzen.


findcomponent hab ich nich mit drin. muss das mit rein ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 25.04.10 18:45 
Ja
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 25.04.10 19:49 
Hi :)

Wenn du die Edit-Felder über einen Index ansprechen willst, ja: Array oder Findcomponent. Und in ein Array müssen sie zu Anfang einmal hereingespeichert werden.

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Mi 28.04.10 19:15 
muss ich denn die edit felder über n array ansprechen zum speichern ? oder gehts auch anders/einfacher/schneller ? die edit felder ändern sich ja nicht mehr in der anzahl.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mi 28.04.10 19:58 
Hi :)

Wenn du sie in ein Array speichern willst, musst du sie dazu ja einzeln ansprechen, und reinschreiben. :nixweiss:
Die Zweite Möglichkeit wäre wi gesagt FindComponent(), das ist etwas langsamer. Aber das ist hier ja egal :)

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Do 29.04.10 20:26 
kannst du mal schauen ?
Einloggen, um Attachments anzusehen!
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: Sa 01.05.10 17:03 
muss ich die edits extern speichern ? also muss das immer in ne textdatei oder so sein ? kann man das nicht so machen, dass die jedesmal wenn ich das programm schließe automatisch in der exe gespeichert werden ?
oder wäre das eine für mich unlösbare aufgabe ?
blaky
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Sa 01.05.10 17:56 
als kleine Anregung kannste dir die Lottozahlen auch von hier
www.dielottozahlen.d...o/6aus49/6aus49.html

auslesen.

lotto
Einloggen, um Attachments anzusehen!
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: So 02.05.10 12:47 
ich kann dein proggie nicht downloaden :( --> EDIT: ging doch
fehler beim ausführen deines proggies: " ist kein gültiger integerwert
hab aber alles ordentlich ausgefüllt

die idee, die zahlen ausm netz auszulesen hatte ich auch ;) aber das wäre erst dann eingebaut worden, wenn ich das wissen dazu habe :D
immo hängts ja schon bei einfachen sachen wie speichern :p wie hast du das bei dir hinbekommen ? da speicherst du ja alles schön in eine ini rein. gefällt mir

trotzdem danke für die idee mit onlineabgleich ;)
blaky
Hält's aus hier
Beiträge: 4



BeitragVerfasst: So 02.05.10 14:42 
:cry: grade gestern ändern die ihre Webpage wo ich die Zahlen herhole...

hier die gefixte Version

Was die InI Files angeht such mal nach Tinifiles.. ist eigentlich ganz einfach

MFG
blaky
Einloggen, um Attachments anzusehen!
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: So 02.05.10 16:28 
wie finde ich tinifile ? ich hab CodeGear Delphi 2009 und da isses nich dabei. muss ich das irgendwie erst "reininstallieren" ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 02.05.10 16:32 
user profile iconnoo.bee hat folgendes geschrieben Zum zitierten Posting springen:
wie finde ich tinifile ?
Indem du F1 drückst und in der Hilfe feststellst, dass es in der Suche in der Delphi-Reference UNIT INIFILES enthalten ist... :roll:

Wobei man nicht vergessen sollte, dass die INI-Dateien bzw. die Methoden für den Zugriff darauf als veraltet markiert sind. Diese sind nur für Kompatibilität mit Windows 3.1 noch enthalten, könnten also jederzeit in einer neuen Windowsversion verschwinden... (ist ja immerhin schon über 15 Jahre alt)
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: So 02.05.10 16:59 
jo habs grad schon gefunden gehabt, trotzdem danke ;)

habs jetzt so:

ausblenden 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:
// Speichern
procedure TForm1.Button2Click(Sender: TObject);
begin
  ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+
    'lotto.ini');
    ini.WriteString('Feld 1','Tip 1',edit1.Text);
    ini.WriteString('Feld 1','Tip 2',edit2.Text);
    ini.WriteString('Feld 1','Tip 3',edit3.Text);
    ini.WriteString('Feld 1','Tip 4',edit4.Text);
    ini.WriteString('Feld 1','Tip 5',edit5.Text);
    ini.WriteString('Feld 1','Tip 6',edit6.Text);
end;

//Laden
procedure TForm1.Button3Click(Sender: TObject);
begin
  try
    edit1.Text:=ini.ReadString('Feld 1','Tip 1',edit1.Text);
    edit2.Text:=ini.ReadString('Feld 1','Tip 2',edit2.Text);
    edit3.Text:=ini.ReadString('Feld 1','Tip 3',edit3.Text);
    edit4.Text:=ini.ReadString('Feld 1','Tip 4',edit4.Text);
    edit5.Text:=ini.ReadString('Feld 1','Tip 5',edit5.Text);
    edit6.Text:=ini.ReadString('Feld 1','Tip 6',edit6.Text);
  finally
    ini.free;
  end;
end;


speichern geht wunderbar. in der ini steht alles so drin wie es soll. aber ich bekomme beim laden immer zugriffsverletzung. wo is da mein fehler ?
Stundenplan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 32

Win 7
Delphi 7 Pers., C# (VS 2010 Express)
BeitragVerfasst: So 02.05.10 18:59 
Vielleicht hast du noch nicht auf Laden geklickt - da wird nämlich erst "ini" erzeugt!

Mache ini mal lokal, also so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure ButtonXYZClick(Sender: TObject);
var ini: TIniFile;
begin
   ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+    'lotto.ini');
   try
     //Zugriffe
   finally
     ini.Free;
   end;
end;
noo.bee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 120



BeitragVerfasst: So 02.05.10 19:03 
höö, hat tatsächlich funktioniert :D dann kann ich ja endlich das nächste prob angehen.

DANKE AN ALLE HELFENDEN