AGB  ·  Datenschutz  ·  Impressum  







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

Filename AutoInc name

Ein Thema von mohfa · begonnen am 17. Okt 2008 · letzter Beitrag vom 18. Okt 2008
 
Cyf

Registriert seit: 30. Mai 2008
407 Beiträge
 
Lazarus
 
#6

Re: Filename AutoInc name

  Alt 18. Okt 2008, 21:43
Something like this should work, but if you have a large number of log files, it may be an ineffective way to iterate, also you have to check for the maximal value of Cardinal.

Delphi-Quellcode:
procedure CreateLog;
var i: Cardinal;
begin
  i:= 1;
  while FileExists(IntToStr(i)+'.log') do //use format for left-hand zeros
  begin
    inc(i);
  end;
  //CreateFile ...
end;
  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 07:32 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