![]() |
AW: Zu wenig Arbeitsspeicher Fehler
Ja, das mit der ini hatte ich auch gemerkt..
|
AW: Zu wenig Arbeitsspeicher Fehler
Und damit sind alle Vorschläge über Bord geworfen. Ich bin gespannt, was Du machst, wenn Du mal eines Deiner Arrays sortieren willst.
|
AW: Zu wenig Arbeitsspeicher Fehler
Und so sieht das dann in lesbar aus
Delphi-Quellcode:
und der Fehler wäre dir sofort ins Auge gefallen - nein, du hättest den erst nicht gemacht, weil es schon komisch aussieht
procedure TForm1.FormCreate( Sender : TObject );
var LIni : TInifile; LCount : Integer; begin LIni := TInifile.Create( 'C:\ProgramData\L-Write\crepesworker_user.ini' ); try LCount := LIni.ReadInteger( 'Anzahl', 'Anzahl', 0 ); finally LIni.Free; end; SetLength( FVorname, LCount ); SetLength( FName, LCount ); SetLength( FPin, LCount ); SetLength( FBearb, LCount ); GetList( LCount ); Scrollbar1.Max := LCount; end; procedure TForm1.GetList( ACount : Integer ); var LIni : TInifile; LIdx : Integer; LUserSection : String; begin LIni := TInifile.Create( 'C:\ProgramData\L-Write\crepesworker_user.ini' ); try for LIdx := 0 to ACount - 1 do begin LUserSection := 'User' + IntToStr( LIdx ); FVorname[LIdx] := LIni.ReadString( LUserSection, 'Vorname', 'Not_found' ); FName[LIdx] := LIni.ReadString( LUserSection, 'Name', 'Not_found' ); FPin[LIdx] := LIni.ReadInteger( LUserSection, 'Pin', 0 ); FBearb[LIdx] := LIni.ReadBool( LUserSection, 'Bearb', true ); end; finally LIni.Free end; end;
Delphi-Quellcode:
Komisch, selbst bei diesem Code-Fragment weiß man sofort, welche Variablen lokal, welche die Argumente sind und welche zur Klasse gehören.
for LIdx := 0 to ACount - 1 do
begin LUserSection := 'User' + IntToStr( LIdx ); FVorname[ACount] := LIni.ReadString( LUserSection, 'Vorname', 'Not_found' ); FName[ACount] := LIni.ReadString( LUserSection, 'Name', 'Not_found' ); FPin[ACount] := LIni.ReadInteger( LUserSection, 'Pin', 0 ); FBearb[ACount] := LIni.ReadBool( LUserSection, 'Bearb', true ); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:23 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz