Página 1 de 1

Traducir de VB a DELPHI

Publicado: 15 Feb 2010, 16:51
por josfres
Hola algien me puede ayudar a traducir esto a codigo delphi porfavor se los agradeceria mucho

Código: Seleccionar todo

On Error Resume Next
Dim filt As String
filt = "C:\Stub.bat"
SetAttr filt, 0
If Len(Dir(filt)) Then
Text1.Text = ""
Open filt For Input As #1
Do While Not EOF(1)
Line Input #1, renglon
todo = todo & renglon & vbCrLf
Loop
Text1.Text = todo
Close #1
End If

Re: Traducir de VB a DELPHI

Publicado: 15 Feb 2010, 20:04
por D@rB-15

Código: Seleccionar todo

Var
  filt, Linea, Todo: String;
  Archivo: TextFile;

Begin
  filt := 'C:/Stub.bat';
  If FileExists(filt)
    Then
      Begin
        Edit1.Text := '';
        AssignFile(Archivo, Filt);
        Reset(Archivo);
        While Not EOF(Archivo) Do
          Begin
            ReadLn(Archivo, Linea);
            Todo := Todo + Linea + sLineBreak;
          End;
        Edit1.Text := Todo;
        CloseFile(Archivo);
      End;
End;

Re: Traducir de VB a DELPHI

Publicado: 16 Feb 2010, 03:51
por josfres
Gracias probare este metodo gracias por tu tiempo