Ver Mensaje Individual
  #7  
Antiguo 20-11-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 22
cHackAll Va por buen camino
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject); // Creando archivos con nombre secuencial...
var Count: Cardinal;
begin
 Count := 0;
 while GetFileAttributes(PChar(IntToStr(Count)+'.txt')) <> INVALID_HANDLE_VALUE do
  Inc(Count);
// IntToStr(Count)+'.txt';
end;

Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject); // 'Append' con valores numéricos secuenciales en un archivo de texto.
var Archivo: TextFile; Line: string;
begin
 AssignFile(Archivo, 'texto.txt');
 Reset(Archivo);
 while not EOF(Archivo) do ReadLn(Archivo, Line);
 WriteLn(Archivo, IntToStr(StrToInt(Line) + 1));
 CloseFile(Archivo);
end;
Responder Con Cita