1. Something weird

--------------3DBBF0EFDD7E3C1219761B7E

I was writing this simple program that had the user input a word, and
then the program searched a list of 200 words to find a match.  It then
printed out on screen whether the word (or part of the word) was found
or not, what number the word was in the sequence, etc.  Simple stuff,
yes, not meant for use other to see how match() worked, and how fast.

Anyway, for some reason when the cursor got to the bottom of the screen,
replies from the program tacked an extra line feed on. When I took the
"\n" out of the beginning of my output, the program still tacked a LF
on, but not a carriage return.  Example:

         prog output       user input      output
    What is the word? stop
                                        That was word# 175.

So I put in a get_position() to take care of it.  If the row was 25,
then the program did not output a LF, but it did put in a CR, or ASCII
13.

All of this is no big deal, but I ask, why would Euphoria do this?  I
put a trace(1) in and saw nothing in my code that would cause this.

Thanks!!
Kevin

--------------3DBBF0EFDD7E3C1219761B7E

<HTML>
I was writing this simple program that had the user input a word, and then
the program searched a list of 200 words to find a match.&nbsp; It then
printed out on screen whether the word (or part of the word) was found
or not, what number the word was in the sequence, etc.&nbsp; Simple stuff,
yes, not meant for use other to see how match() worked, and how fast.

<P>Anyway, for some reason when the cursor got to the bottom of the screen,
replies from the program tacked an extra line feed on. When I took the
"\n" out of the beginning of my output, the program still tacked a LF on,
but not a carriage return.&nbsp; Example:
<BR>&nbsp;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <U>prog
 output</U>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<U>user input</U>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <U>output</U>
<BR>&nbsp;&nbsp;&nbsp; What is the word? stop
 p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
 ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
That was word# 175.

<P>So I put in a get_position() to take care of it.&nbsp; If the row was
25, then the program did not output a LF, but it did put in a CR, or ASCII
13.

<P>All of this is no big deal, but I ask, why would Euphoria do this?&nbsp;
I put a trace(1) in and saw nothing in my code that would cause this.

<P>Thanks!!
<BR>Kevin</HTML>

--------------3DBBF0EFDD7E3C1219761B7E--

new topic     » topic index » view message » categorize

2. Re: Something weird

Er, ah. ignore the &nbs p;...something my mailer tagged on.

Kevin Sieger wrote:

>  I was writing this simple program that had the user input a word, and
> then the program searched a list of 200 words to find a match.  It
> then printed out on screen whether the word (or part of the word) was
> found or not, what number the word was in the sequence, etc.  Simple
> stuff, yes, not meant for use other to see how match() worked, and how
> fast.
>
> Anyway, for some reason when the cursor got to the bottom of the
> screen, replies from the program tacked an extra line feed on. When I
> took the "\n" out of the beginning of my output, the program still
> tacked a LF on, but not a carriage return.  Example:
>
>          prog output       user input      output
>     What is the word? stop
>             &nbs p;              ;              That was word# 175.
>
> So I put in a get_position() to take care of it.  If the row was 25,
> then the program did not output a LF, but it did put in a CR, or ASCII
> 13.
>
> All of this is no big deal, but I ask, why would Euphoria do this?  I
> put a trace(1) in and saw nothing in my code that would cause this.
>
> Thanks!!
> Kevin

new topic     » goto parent     » topic index » view message » categorize

3. Re: Something weird

Keven Sieger writes:
> Anyway, for some reason when the cursor got to the
> bottom of the screen, replies from the program tacked
> an extra line feed on. When I took the "\n" out of the beginning
> of my output, the program still tacked a LF on, but not
> a carriage return.

From LIBRARY.DOC, gets() routine:
   After reading a line of text from the keyboard, you should
   normally output a \n character, e.g. puts(1, '\n'), before
   printing something. Only on the last line of the screen does the
   operating system automatically scroll the screen and advance to
   the next line.

It's a quirky thing about DOS. Euphoria is not
doing anything different at the bottom of the screen.
Several people have asked about this over the years.
Use get_position() and position() if you need better control.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu