Ver Mensaje Individual
  #3  
Antiguo 29-10-2019
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.309
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
En Delphi un programilla como este debería cubir lo que necesitas:
Código Delphi [-]

program PLeerEntradaStd;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  Vcl.Forms, Winapi.Windows, System.SysUtils, System.Classes, VCL.Dialogs;

var
  Buffer: array[0..1000] of Byte;
  StdIn: TStream;
  Count: Integer;
  i: integer;
  Str: string;
begin
  try
    StdIn := THandleStream.Create(GetStdHandle(STD_INPUT_HANDLE));
    Count := StdIn.Read(Buffer, 1000);
    StdIn.Free;
    for i := 0 to (Count - 1) do begin
      Str := Str + Char(Buffer[i]);
    end;
    ShowMessage(Str);
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.


Una ejecución como esta devolverá el valor leído:


__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita