Re: bug in position()
- Posted by Chris Burch <chriscrylex at aol.com> Sep 25, 2005
- 506 views
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