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