Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Ini laden -> Programm stürzt ab (https://www.delphipraxis.net/30998-ini-laden-programm-stuerzt-ab.html)

APP 3. Okt 2004 14:53

Re: Ini laden -> Programm stürzt ab
 
Hallo supermuckl,
zwar etwas verspätet, aber auf alle Fälle sollte das TRY/FINALLY Konstrukt so aussehen:

Code:
PROCEDURE TFigur.LoadStats;
VAR
  Ini                             : TIniFile;
BEGIN
[color=red][b] Ini := TIniFile.Create(ExtractFilePath(Application.Exename) + 'stats.ini');
  TRY[/b][/color]  
    Name_ := Ini.ReadString('Settings', 'Name', '');
    [..]
    Disziplin := Ini.ReadString('Settings', 'Disziplin', '');
  FINALLY
    Ini.Free;
  END;
END;
und irgendwann auch mal wieder monster.free falls du mehrere hast und eins stirbt mal oderso ;)[/quote]


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:31 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz