Autor Beitrag
DDenker
Hält's aus hier
Beiträge: 4


D7 Pers
BeitragVerfasst: Sa 18.12.04 11:13 
Hi, habe mich gestern schonmal etwas durchgelesen und bin auch schon etwas weiter gekommen,
und jetzt funktioniert der erste Teiel des Programms auch schon, aber es kommt ein Fehler
beim compilieren, danach funktionier aber alles soweit ...
hier ist mal dr code :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.FormCreate(Sender: TObject);
var
  Ini: TIniFile;
  i: integer;
begin
  try
    Ini:=TIniFile.Create('C:\Dokumente und Einstellungen\DDenker\Eigene Dateien\niv Neocron Item Verwalter\weapons.ini');
    for i := 1 to 50 do
    begin
      TLabel(FindComponent('Label' + IntToStr(I))).caption:=Ini.ReadString('a'+inttostr(i),'Name','Fehler') ;
      TLabel(FindComponent('Label' + IntToStr(I))).hint:=Ini.ReadString('a'+inttostr(i),'Anf','Fehler') ;
    end;
  finally
  Ini.Free;
  end;
end;


wäre super, wenn mir da mal wer helfen könnte ;)
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 18.12.04 11:22 
Wäre super, wenn du uns sagen würdest welcher Fehler ;)

AXMD
DDenker Threadstarter
Hält's aus hier
Beiträge: 4


D7 Pers
BeitragVerfasst: Sa 18.12.04 11:48 
stimmt, hab ich ganz vergessen
user defined image
der obere fehler kommt beim ersten compilieren, der andere wenn ich dann nochmal f9 drücke
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Sa 18.12.04 11:51 
Also bei AccessViolation kann man schlecht den richtigen Fehler finden!

So funzt es....

Hint hat den Fehler verursacht, es reagiert anders als Caption!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.FormCreate(Sender: TObject);
var
  Ini: TIniFile;
  i: integer;
  xlabel:TLabel;
begin
  try
    Ini:=TIniFile.Create('C:\Dokumente und Einstellungen\DDenker\Eigene Dateien\niv Neocron Item Verwalter\weapons.ini');
    for i := 1 to 50 do
    begin
      xlabel:=TLabel(FindComponent('Label' + IntToStr(I)));
      if NOT (xlabel=nil) then 
      begin 
        xlabel.caption:=Ini.ReadString('a'+inttostr(i),'Name','Fehler') ;
        xlabel.hint:=Ini.ReadString('a'+inttostr(i),'Anf','Fehler') ;
      end;
    end;
  finally
    Ini.Free;
  end;
end;
DDenker Threadstarter
Hält's aus hier
Beiträge: 4


D7 Pers
BeitragVerfasst: Sa 18.12.04 15:32 
jo vielen dank, funktioniert super!
dann hab ich noch ne kleine frage ... in der ini datei die da eingelesen wird
steht unter anderem 'A&W'
im programm ist das &-zeichen dann natürlich weg und das W unterstrichen
wie mache ich das jetzt, dass der das & anzeigt ?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Sa 18.12.04 15:43 
Schreibe einfach 'A&&W'
DDenker Threadstarter
Hält's aus hier
Beiträge: 4


D7 Pers
BeitragVerfasst: Sa 18.12.04 15:45 
cool, das wars
danke euch allen