Re: Using gets (0)
- Posted by Irv Mullins <irv at ELLIJAY.COM> Dec 17, 1997
- 697 views
At 04:30 PM 12/17/97 -0800, you wrote: >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at >MIAMIU.ACS.MUOHIO.EDU> >Poster: Bob Hancock <bob at SPEED.NET> >Subject: Using gets (0) >------------------------------------------------------------------------------- > > Hi: > > I'm trying to prompt the user for an output filename, into which I will >write data. > Anyone can show me what simple thing I'm missing? Thanks. > > -- Bob Hancock , [bob at speed.net] > Bob: I think you need to remove the trailing linefeed (10) character that is appended to the input string: If you type hello.exe the sequence returned is {104,101,108,108,111,46,101,120,101,10} You get around this by saying: fn=fn[1..length(fn)-1] which strips off the final byte. then you can say: ok=open(fn,"r") and if you get a -1, then file wasn't found, else it was. User does not have to enter double \\'s by the way. The single ones work just fine. Irv