AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

File compare

Ein Thema von value is NULL · begonnen am 24. Mai 2011 · letzter Beitrag vom 24. Mai 2011
 
value is NULL

Registriert seit: 10. Sep 2010
249 Beiträge
 
#26

AW: File compare

  Alt 24. Mai 2011, 14:40
OK, bin halt eher unskilled, habs jetzt aber, zumindest funktionierts

Delphi-Quellcode:
function test(const First, Second: TFilename; out stringL: TStringlist): Boolean;
var
  s1, s2: TStringlist;
  i: integer;
begin
  Result := FileExists(First) and FileExists(Second);
  if Result then
    begin
      s1 := TStringlist.Create;
      try
        s1.LoadFromFile(First);
        s2 := TStringlist.Create;
        try
          s2.LoadFromFile(Second);
          i := 0;
              while (i < s1.Count) and (i < s2.Count) do
              begin
                Result := s1[i] = s2[i];
                if not Result then
                  begin
                    stringL.Add(s1[i]);
                    //i := s1.Count;
                  end;
                  inc(i);
                end;
        finally
          s2.Free;
        end;
      finally
        s1.Free;
      end;
    end;
end;
aufruf:

Delphi-Quellcode:
    try
      sl := TStringlist.Create;
      test_functions.test('C:\software.txt','C:\software2.txt',sl);
      Writeln(sl.Text);
    finally
      sl.Free;
    end;
Könnte man hier etwas aussetzen ?

LG
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:35 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