Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2004, 11:06 PM
suatu suatu is offline
Junior Member
 
Join Date: Dec 2004
Posts: 2
Default stdin.readline

Hi,
Can someone tell me the equivalent of the following
wbscript code in Delphi.

====================================
Set StdOut = WScript.StdOut
Set StdIn = WScript.StdIn

Dim InputString
Do While Not StdIn.AtEndOfStream
InputString = StdIn.ReadLine
Loop
====================================

Regards,Suat.
Reply With Quote
  #2  
Old 12-23-2004, 05:17 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: stdin.readline

Code:
var
  File   : TextFile;
  Input : string;
  Buffer : String;
begin

  AssignFile(File, 'c:\test.txt');   { File selected }
  Reset(File); {Opens for read}
  Buffer := '';

  While not Eof(File) do {Do until End of File marker}
      begin
      Readln(File, Input);
      Buffer := Buffer + Input + ' '+chr(13);{Fills Buffer and adds CRs}
      end;
  CloseFile(File);
end;
Reply With Quote
  #3  
Old 12-23-2004, 08:51 PM
suatu suatu is offline
Junior Member
 
Join Date: Dec 2004
Posts: 2
Default RE: stdin.readline

Hi,
Thanks for your answer but What I want is exactly this:
There is program (I didn't write) which takes a parameter
to send its output. When I read the manual of this program
it says," The program pumps the data to the program you
specify". There is also a little VB script(I wrote in the first message) to achieve this.
I then wrote a program resembling yours but it didn't work.
This thirt party program uses our program as standart output. So I have to use this program as standart input.
Or something else?

Regards,Suat.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 06:36 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.