1. bug in position()
- Posted by jacques deschênes <desja at globetrotter.net> Sep 25, 2005
- 501 views
Hi Robert, As windows consoles may have more than 25 lines, there is a bug with the actual implementation of position(). If line is greater than 25 euphoria crash. (tested on windows xp pro) exemple:
include graphics.e sequence pos pos = get_position() position(pos[1],pos[2]-1) -- crash if pos[1]>25
regards, Jacques Deschênes p.s. Folks forget about my previous message, I read message sequentially and don't check other's reply before replying.
2. Re: bug in position()
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 25, 2005
- 470 views
jacques deschênes wrote: > As windows consoles may have more than 25 lines, there is a bug with the > actual implementation > of position(). > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > exemple: > }}} <eucode> > include graphics.e > sequence pos > pos = get_position() > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > </eucode> {{{ Ok, thanks Jacques. I duplicated the problem on my machine. I'll fix it for the next release. A couple of other people have reported similar problems with consoles over 25 lines. It's not just 2.5, but earlier releases too. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
3. Re: bug in position()
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 25, 2005
- 466 views
Robert Craig wrote: > jacques deschênes wrote: > > As windows consoles may have more than 25 lines, there is a bug with the > > actual implementation > > of position(). > > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > > > exemple: > > }}} <eucode> > > include graphics.e > > sequence pos > > pos = get_position() > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > </eucode> {{{ > > Ok, thanks Jacques. > I duplicated the problem on my machine. > I'll fix it for the next release. > A couple of other people have reported similar > problems with consoles over 25 lines. It's not just 2.5, > but earlier releases too. As a quick fix, try calling text_rows() in graphics.e. That seems to tell Euphoria about the larger number of lines, and stop it from giving a false error report. e.g.
include graphics.e sequence pos if text_rows(43) then end if pos = get_position() position(pos[1],pos[2]-1) -- crash if pos[1]>25
The ed editor does that, and it handles console windows with a large number of lines. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
4. Re: bug in position()
- Posted by Chris Burch <chriscrylex at aol.com> Sep 25, 2005
- 464 views
jacques deschênes wrote: > > > Hi Robert, > As windows consoles may have more than 25 lines, there is a bug with the > actual implementation > of position(). > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > exemple: > }}} <eucode> > include graphics.e > sequence pos > pos = get_position() > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > </eucode> {{{ > > regards, > Jacques Deschênes > > p.s. Folks forget about my previous message, I read message sequentially and > don't > check other's > reply before replying. > Hi I've never thought of this a bug, just a feature of the language. Some screens have lines > 25, and if you have set the screen to one of these modes, then you can write to > 25. SCREEN_LINES tells you how long the screen is SCREEN_LINES = vid_conf[VC_LINES] SCREEN_COLS = vid_conf[VC_COLUMNS] then just wrap position with a check for the length of the screen to prevent crashes. Please, any changes should not affect the abilty to write beyond 25 lines Chris http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/ http://members.aol.com/chriscrylex/EUSQLite/eusql.html
5. Re: bug in position()
- Posted by jacques deschênes <desja at globetrotter.net> Sep 25, 2005
- 519 views
Thanks Robert for the fix, it works regards, Jacques Deschênes Robert Craig wrote: > > Robert Craig wrote: > > jacques deschênes wrote: > > > As windows consoles may have more than 25 lines, there is a bug with the > > > actual implementation > > > of position(). > > > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > > > > > exemple: > > > }}} <eucode> > > > include graphics.e > > > sequence pos > > > pos = get_position() > > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > > </eucode> {{{ > > > > Ok, thanks Jacques. > > I duplicated the problem on my machine. > > I'll fix it for the next release. > > A couple of other people have reported similar > > problems with consoles over 25 lines. It's not just 2.5, > > but earlier releases too. > > As a quick fix, try calling text_rows() > in graphics.e. That seems to tell Euphoria about the larger number > of lines, and stop it from giving a false error report. e.g. > > }}} <eucode> > include graphics.e > sequence pos > > if text_rows(43) then > end if > pos = get_position() > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > </eucode> {{{ > > The ed editor does that, and it handles > console windows with a large number of lines. > > Regards, > Rob Craig > Rapid Deployment Software > <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a> >
6. Re: bug in position()
- Posted by jacques deschênes <desja at globetrotter.net> Sep 25, 2005
- 479 views
The bug that get_position() return the right line number event if its greater than 25 so position() should not crash when passing it parameters obtained from get_position() as shown in my exemple. jacques Chris Burch wrote: > > jacques deschênes wrote: > > > > > > Hi Robert, > > As windows consoles may have more than 25 lines, there is a bug with the > > actual implementation > > of position(). > > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > > > exemple: > > }}} <eucode> > > include graphics.e > > sequence pos > > pos = get_position() > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > </eucode> {{{ > > > > regards, > > Jacques Deschênes > > > > p.s. Folks forget about my previous message, I read message sequentially and > > don't > > check other's > > reply before replying. > > > > Hi > > I've never thought of this a bug, just a feature of the language. Some screens > have lines > > 25, and if you have set the screen to one of these modes, then you can write > > to > > 25. SCREEN_LINES tells you how long the screen is > > SCREEN_LINES = vid_conf[VC_LINES] > SCREEN_COLS = vid_conf[VC_COLUMNS] > > > then just wrap position with a check for the length of the screen to prevent > crashes. > > Please, any changes should not affect the abilty to write beyond 25 lines > > Chris > > <a > href="http://members.aol.com/chriscrylex/euphoria.htm">http://members.aol.com/chriscrylex/euphoria.htm</a> > <a href="http://uboard.proboards32.com/">http://uboard.proboards32.com/</a> > <a > href="http://members.aol.com/chriscrylex/EUSQLite/eusql.html">http://members.aol.com/chriscrylex/EUSQLite/eusql.html</a> >
7. Re: bug in position()
- Posted by Chris Burch <chriscrylex at aol.com> Sep 25, 2005
- 531 views
- Last edited Sep 26, 2005
jacques deschênes wrote: > > The bug that get_position() return the right line number event if its greater > than 25 so position() should not crash when passing it parameters obtained > from > get_position() as shown in my exemple. > > jacques > > > Chris Burch wrote: > > > > jacques deschênes wrote: > > > > > > > > > Hi Robert, > > > As windows consoles may have more than 25 lines, there is a bug with the > > > actual implementation > > > of position(). > > > If line is greater than 25 euphoria crash. (tested on windows xp pro) > > > > > > exemple: > > > }}} <eucode> > > > include graphics.e > > > sequence pos > > > pos = get_position() > > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > > </eucode> {{{ > > > > > > regards, > > > Jacques Deschênes > > > > > > p.s. Folks forget about my previous message, I read message sequentially > > > and don't > > > check other's > > > reply before replying. > > > > > > > Hi > > > > I've never thought of this a bug, just a feature of the language. Some > > screens have lines > > > 25, and if you have set the screen to one of these modes, then you can > > > write to > > > 25. SCREEN_LINES tells you how long the screen is > > > > SCREEN_LINES = vid_conf[VC_LINES] > > SCREEN_COLS = vid_conf[VC_COLUMNS] > > > > > > then just wrap position with a check for the length of the screen to prevent > > crashes. > > > > Please, any changes should not affect the abilty to write beyond 25 lines > > > > Chris > > > > <a > > href="http://members.aol.com/chriscrylex/euphoria.htm">http://members.aol.com/chriscrylex/euphoria.htm</a> > > <a href="http://uboard.proboards32.com/">http://uboard.proboards32.com/</a> > > <a > > href="http://members.aol.com/chriscrylex/EUSQLite/eusql.html">http://members.aol.com/chriscrylex/EUSQLite/eusql.html</a> > > > Hi Yes, I realised that after I'd pressed the send now button, then ran out to take my son to rugby etc etc Chris http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/ http://members.aol.com/chriscrylex/EUSQLite/eusql.html
8. Re: bug in position()
- Posted by "Juergen Luethje" <j.lue at gmx.de> Sep 27, 2005
- 472 views
Robert Craig wrote: > Robert Craig wrote: > >> jacques desch=EAnes wrote: >> >>> As windows consoles may have more than 25 lines, there is a bug with >>> the actual implementation of position(). >>> If line is greater than 25 euphoria crash. (tested on windows xp pro) >>> >>> exemple: >>> }}} <eucode> >>> include graphics.e >>> sequence pos >>> pos = get_position() >>> position(pos[1],pos[2]-1) -- crash if pos[1]>25 >>> </eucode> {{{ >> >> Ok, thanks Jacques. >> I duplicated the problem on my machine. >> I'll fix it for the next release. >> A couple of other people have reported similar >> problems with consoles over 25 lines. It's not just 2.5, >> but earlier releases too. Just for the sake of completeness: The problem does *not* exist on my Windows 98 machine. Someone else reported to me the same problem under Win 2000 SP4. I could duplicate it under Windows XP, using a console window with 25(!) lines, so not only consoles with over 25 lines are affected. I used something like
pos = get_position() position(pos[1], 1)
I don't have a Windows XP machine here right now, and unfortunately I forgot to write down the error message, but as far as I recall it was something like "Can't move cursor to line 27" or so. So it seems to be a bug in get_position() rather than position(). pos[1] is provided by get_position(), which should always be an existing line, shouldn't it? > As a quick fix, try calling text_rows() > in graphics.e. That seems to tell Euphoria about the larger number > of lines, and stop it from giving a false error report. e.g. > > }}} <eucode> > include graphics.e > sequence pos > > if text_rows(43) then > end if > pos = get_position() > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > </eucode> {{{ That worked for me, too. Thanks! > The ed editor does that, and it handles > console windows with a large number of lines. Regards, Juergen -- Have you read a good program lately?
9. Re: bug in position()
- Posted by Al Getz <Xaxo at aol.com> Sep 27, 2005
- 463 views
Juergen Luethje wrote: > > Robert Craig wrote: > > > Robert Craig wrote: > > > >> jacques desch=EAnes wrote: > >> > >>> As windows consoles may have more than 25 lines, there is a bug with > >>> the actual implementation of position(). > >>> If line is greater than 25 euphoria crash. (tested on windows xp pro) > >>> > >>> exemple: > >>> }}} <eucode> > >>> include graphics.e > >>> sequence pos > >>> pos = get_position() > >>> position(pos[1],pos[2]-1) -- crash if pos[1]>25 > >>> </eucode> {{{ > >> > >> Ok, thanks Jacques. > >> I duplicated the problem on my machine. > >> I'll fix it for the next release. > >> A couple of other people have reported similar > >> problems with consoles over 25 lines. It's not just 2.5, > >> but earlier releases too. > > Just for the sake of completeness: > The problem does *not* exist on my Windows 98 machine. > Someone else reported to me the same problem under Win 2000 SP4. > I could duplicate it under Windows XP, using a console window with > 25(!) lines, so not only consoles with over 25 lines are affected. > > I used something like > }}} <eucode> > pos = get_position() > position(pos[1], 1) > </eucode> {{{ > > I don't have a Windows XP machine here right now, and unfortunately I > forgot to write down the error message, but as far as I recall it was > something like "Can't move cursor to line 27" or so. > So it seems to be a bug in get_position() rather than position(). > pos[1] is provided by get_position(), which should always be an existing > line, shouldn't it? > > > As a quick fix, try calling text_rows() > > in graphics.e. That seems to tell Euphoria about the larger number > > of lines, and stop it from giving a false error report. e.g. > > > > }}} <eucode> > > include graphics.e > > sequence pos > > > > if text_rows(43) then > > end if > > pos = get_position() > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > </eucode> {{{ > > That worked for me, too. Thanks! > > > The ed editor does that, and it handles > > console windows with a large number of lines. > > Regards, > Juergen > > -- > Have you read a good program lately? > > Hi there, Another possibility might be to check first with video_config()... s=video_config() if s[VC_LINES]>=26 then position(26,1) puts(1,"26") else scroll(1,1,25) position(25,1) puts(1,"25") end if Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"
10. Re: bug in position()
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 27, 2005
- 464 views
Juergen Luethje wrote: > > Robert Craig wrote: > > > Robert Craig wrote: > > > >> jacques desch=EAnes wrote: > >> > >>> As windows consoles may have more than 25 lines, there is a bug with > >>> the actual implementation of position(). > >>> If line is greater than 25 euphoria crash. (tested on windows xp pro) > >>> > >>> exemple: > >>> }}} <eucode> > >>> include graphics.e > >>> sequence pos > >>> pos = get_position() > >>> position(pos[1],pos[2]-1) -- crash if pos[1]>25 > >>> </eucode> {{{ > >> > >> Ok, thanks Jacques. > >> I duplicated the problem on my machine. > >> I'll fix it for the next release. > >> A couple of other people have reported similar > >> problems with consoles over 25 lines. It's not just 2.5, > >> but earlier releases too. > > Just for the sake of completeness: > The problem does *not* exist on my Windows 98 machine. > Someone else reported to me the same problem under Win 2000 SP4. > I could duplicate it under Windows XP, using a console window with > 25(!) lines, so not only consoles with over 25 lines are affected. > > I used something like > }}} <eucode> > pos = get_position() > position(pos[1], 1) > </eucode> {{{ > > I don't have a Windows XP machine here right now, and unfortunately I > forgot to write down the error message, but as far as I recall it was > something like "Can't move cursor to line 27" or so. > So it seems to be a bug in get_position() rather than position(). > pos[1] is provided by get_position(), which should always be an existing > line, shouldn't it? > > > As a quick fix, try calling text_rows() > > in graphics.e. That seems to tell Euphoria about the larger number > > of lines, and stop it from giving a false error report. e.g. > > > > }}} <eucode> > > include graphics.e > > sequence pos > > > > if text_rows(43) then > > end if > > pos = get_position() > > position(pos[1],pos[2]-1) -- crash if pos[1]>25 > > </eucode> {{{ > > That worked for me, too. Thanks! > > > The ed editor does that, and it handles > > console windows with a large number of lines. Thanks. I'll keep all this information in mind when I debug it. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com