Re: bug in position()

new topic     » goto parent     » topic index » view thread      » older message » newer message

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>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu