L : string;
L : char;
AssignFile(F,FicTest); try ...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionvar FS : TFileStream; MSb : TMemoryStream; I : LongInt; fFCount : Real; // Pour séparation des milliers dans Format L,M : String; C : Char; TailleBloc: Integer; Ligne : array [1..12] of char; begin {initialisations locales} ... {DEBUT TRAITEMENT LONG} {1. Transfert des lignes du Fichier dans une TList afin de trier rapidement les valeurs du fichier d'origine par ordre alphabétique croissant} FS := TFileStream.Create(FicTest, fmOpenRead ); TailleBloc := 12; L := ''; C := #0; For I:=1 to FS.Size div TailleBloc do Begin MSb := TMemoryStream.Create; // Création bloc MSb.CopyFrom(FS,TailleBloc); // Copie d'un bloc MSb.Position := 0; // Index début de Bloc MSb.Read(Ligne,12); L := Ligne; If not ((Ligne[11] = #13 ) and (Ligne[12] = #10)) then begin inc(FError); FMsgLog := ' - er n°'+InttoStr(FError)+' : '+L; Synchronize(AffichageMemoLog); end; ListLignesFic.Add(L); Inc(FCount); end; FS.Free; ListLignesFic.Sort; fFCount := FCount; FMsgLog := ' - '+Format('%.0n',[fFCount/1])+' éléments triés'; Synchronize(AffichageMemoLog); FMessage := 'Triage du Fichier effectué...'; Synchronize(AfficherMessage); ... if FError = 0 then begin FMsgLog := 'Vérification longueur des '+inttoStr(FCount)+' enregistrements effectuée'; Synchronize(AffichageMemoLog); FMsgLog := '- Aucune erreur détectée'; Synchronize(AffichageMemoLog); end;