Cory

I must disagree - It does exactly what i want - that is reads std input into
a graphical app -

try

procedure TForm1.FormCreate(Sender: TObject);
var
  s: string;
  count: integer;
begin
  try
    AllocConsole;
    Memo1.Lines.BeginUpdate;
    Memo1.Lines.Clear;
    repeat
      {$I-}
      Readln(Input,s);
      {$I+}
      if (IOResult <> 0) then Break;
      inc(count,length(s));
      Memo1.Lines.Add(s);
    until EOF(Input);
  finally
    FreeConsole;
    Memo1.Lines.EndUpdate;
  end;
end;



----- Original Message -----
From: Corey Murtagh <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Sunday, 29 October 2000 18:23
Subject: Re: [DUG]: Access to Standard Input in a non console app


> Neven MacEwan wrote:
> >
> > Cory
> >
> > Found two interesting functions -- AllocConsole and FreeConsole on
> > Delphi3000
> > http://www.delphi3000.com/article.asp?id=568
> > Which open and Free the Console Window
> > Now I need to find how to hide the console window
>
> The gui console functions are for creating a new console, which
> unfortunately won't help with getting data piped in from the commandline.
I
> haven't found a use for those console functions yet... but no doubt there
is
> one :)
>
> The point I was trying to get across in the last post was that because
> Windows uses a totally different paradigm it doesn't allocate input and
> output handles for a GUI program, so you can't just pipe from the
> commandline like you could in dos.  Probably the easiest thing to do is
give
> command-line options for reading data from a file.
>
> --
> Corey Murtagh
> The Electric Monk
> "Quidquid latine dictum sit, altum viditur!"
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to