[Gambas-user] reopen standard input

Robin Thompson robane00 at ...67...
Thu May 29 22:45:56 CEST 2008


Hi,

I'm trouble with a console program i'm writing.  Basically it requires user input from the console.  But the program itself is run from a pipe 

i.e cmd1 | myprog.gambas

PUBLIC SUB Main()
DIM a AS Integer
DIM inputline AS NEW String[]
DIM ipt, f AS String
a = -1

WHILE NOT Eof(file.in)   
a += 1
inputline.Resize(a + 1)
LINE INPUT #file.In, inputline[a] 
WEND 


FOR EACH f IN inputline

LINE INPUT ipt  < --  at this point i get MMain.Main.21: #39: End of file
PRINT #file.out, f & " " & ipt

NEXT 
END

How do I "reopen" standard input?

Thanks,

RT
_________________________________________________________________

http://clk.atdmt.com/UKM/go/msnnkmgl0010000009ukm/direct/01/



More information about the User mailing list