1. Re: EUPHORIA Digest - 10 Apr 1998 to 11 Apr 1998
- Posted by Monty King <boot_me at GEOCITIES.COM> Apr 13, 1998
- 647 views
-----Original Message----- From: Jeff Zeitlin <jeff.zeitlin at MAIL.EXECNET.COM> To: Multiple recipients of list EUPHORIA <EUPHORIA at MIAMIU.ACS.MUOHIO.EDU> Date: Sunday, April 12, 1998 12:03 PM Subject: Re: EUPHORIA Digest - 10 Apr 1998 to 11 Apr 1998 >---------------------- Information from the mail header ----------------------- >Sender: Euphoria Programming for MS-DOS <EUPHORIA at MIAMIU.ACS.MUOHIO.EDU> >Poster: Jeff Zeitlin <jeff.zeitlin at MAIL.EXECNET.COM> >Organization: None To Speak Of >Subject: Re: EUPHORIA Digest - 10 Apr 1998 to 11 Apr 1998 >--------------------------------------------------------------------------- ---- > >On Sun, 12 Apr 1998 00:00:15 -0500, ST Qu Man <STQuMan at AOL.COM> >wrote: > >>I have been doing pretty good in converting over between the two = >languages, >>but I'm stuck on how to transfer the following basic chunk to a Euphoria >>chunk. > >>OPEN "c:\file.txt" FOR OUTPUT AS #1 >>DO >>IF EOF(1) THEN GOTO 1090 >>LINE INPUT #1, d$ >>PRINT d$ >>LOOP >>1090 SLEEP >>END > >There's what appears to be a major bug here - are you sure you >want C:\FILE.TXT to be open for _output_? The rest of the code >suggests that it should be for _input_. On that assumption, and >on the assumption that the SLEEP in 1090 is to wait for a >keypress... > >Really, what you're doing is reading each line of the file and >printing it to the screen - essentially, the equivalent of the >DOS built-in TYPE command. > >I would write this as: > >atom f >object d >atom k > >f =3D open("c:\\file.txt","r") >d =3D gets(f) >while not atom(d) do > puts(1,d & "\n") > d =3Dgets(f) >end while >k =3D wait_key() >-- >Jeff Zeitlin >jeff.zeitlin at mail.execnet.com Jeff, is the 3d supposed to be there?