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