Einzelnen Beitrag anzeigen

heiopei
(Gast)

n/a Beiträge
 
#2

Re: Dateien nummeriert speichern?

  Alt 28. Dez 2005, 10:53
hallo, hab da mal für ne firmensoftware das gleiche problem gehabt.
ich hab das ganze in eine schleife gepackt, etwa so:

Delphi-Quellcode:

begin
  result := 1;
  while fileexists('datei' + IntToStr(result) + '.txt') do
  Inc(result);
end;
die funktion gibt also aus, welche datei mit index i noch nicht existiert - allerdings wird hierbei statt 01, 02, also alle zahlen < 10 nur 1, 2... erkannt!


mfg,
heiopei


//edit: sorry i und result vermischt
  Mit Zitat antworten Zitat