1. Fw: Two questions
- Posted by rforno at tutopia.com Sep 05, 2001
- 419 views
This is a multi-part message in MIME format. ------=_NextPart_000_0122_01C1362B.81B68280 charset="iso-8859-1" I am resending this mail, since apparently it did not reach some people in the list, including myself. ----- Original Message ----- From: "Ricardo M. Forno" <rforno at tutopia.com> To: <EUforum at topica.com> Subject: Two questions > Rob: > I find slightly annoying the need to insert a whitespace character in a file > that has to be read by means of get(), because to create such a file you > would need two instructions for each object, namely: > > print(file, object) > puts(file, "\n") (or puts(file, " ") ) > > Maybe there is an alternative to this that I don't know. > > Another subject: > I'm having problems with the function check_break(). When I use it in the > attached stripped down version of one of my programs, and I type ^C, no > message is printed in spite that ^C appears on the screen. Moreover, if I > type ^2 (that I don't know why it behaves similarly to ^C), two ^C are > printed on the screen the first time, and the message appears the second > time. Then, while typing ^2, it cycles between these two outputs. > > ------=_NextPart_000_0122_01C1362B.81B68280 Content-Type: application/octet-stream; name="xx.ex" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xx.ex" include get.e include file.e function Get_key() --Waits for a keypress integer c while 1 do c = get_key() if c != - 1 then exit end if end while return c end function procedure entry() sequence input_line integer c allow_break(0) while 1 do --Until exit input_line = {} --Initialize reserve of input characters if check_break() then --Advise operator printf(1, "%s\n", {"To quit, press return"}) end if c = Get_key() --Get the first keypress if c = 13 then --If empty input line exit end if end while end procedure entry() --Execute main procedure ------=_NextPart_000_0122_01C1362B.81B68280--
2. Re: Fw: Two questions
- Posted by rforno at tutopia.com Sep 06, 2001
- 413 views
Derek: Of course I did. But what I am questioning is the lack of symmetry between get() and put(), or better, why get() needs a whitespace before the next '{'. It seems very easy to fix this, unless there is a hiden reason for that behavior. ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Subject: RE: Fw: Two questions > > --------------------- > > From: rforno at tutopia.com > > To: EUforum <EUforum at topica.com> > > Reply-To: EUforum at topica.com > > Subject: Fw: Two questions > > Date: 6/09/2001 5:55:03 AM > > > > > > Rob: > > > I find slightly annoying the need to > > insert a whitespace character in a > > file > > > that has to be read by means of get(), > > because to create such a file you > > > would need two instructions for each > > object, namely: > > > > > > print(file, object) > > > puts(file, "\n") (or puts(file, " ") ) > > > > > > Maybe there is an alternative to this > > that I don't know. > > > > Hi Ricardo, > I suppose you already created a ... > > procedure prints(integer fh, object x) > print(fh, x) > puts(fh, ' ') > end procedure > > for yourself. > > ----------- > cheers, > Derek Parnell > Senior Design Engineer > Global Technology Australasia Ltd > dparnell at glotec.com.au > > > -------------------------------------------------------------------- of > -------------------------------------------------------------------- > > >