Subj : fried brain To : Deuce From : MCMLXXIX Date : Mon May 12 2008 11:10 pm Re: fried brain By: Deuce to MCMLXXIX on Mon May 12 2008 18:44:37 > Re: fried brain > By: MCMLXXIX to Deuce on Mon May 12 2008 06:10 pm > > > > console.putmsg(word_wrap(string, 10).replace(/\n/,"\n ")); > > > > > > that would work, sort of... but the idea is to make the text wrap within > > window at either a menu, or in the midst of another script, so having > > preceeding spaces would mess up the surrounding graphics. the distance fr > > the left will also be supplied as a variable and will change depending on > > what's going on.. > > Ok... > console.putmsg(word_wrap(string, 10).replace(/\n/,"\n\1"+ascii(127+10))); > > > you should make word_wrap take a starting_column argument! .... :) > > The word wrap function is in now way connected to output... so a > starting_column argument is pointless. > > Regarding windows, they aren't supported natively. You could do this > functionality using the graphic.js library though: > > load("graphic.js"); > var window=new Graphic(10,24); > window.putmsg(word_wrap(1,1,string, window.width)); > window.draw(1, 10); > I actually had no idea that could be done with Graphic.js, but it didn't seem to work when I tested it anyway. What does word_wrap do? put an \r\n in the supplied string at the supplied width? I have a working function for this, and seems to running just fine now... though that console.putmsg(word_wrap..........); line you wrote up there was a learning experience in itself. --- þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX) .