ID:270693
 
I was wondering how would i do something like a word wrap effect, for example i have a var for a persons Desc. and if the text reachs the right side of the table its in its lowers the text to the next line.
There's probably some HTML attributes you could use for this, but here's a way of doing it:
(I'm taking TMDI's approach to writing code in the form, each _ is a tab)

proc/wrap(string,limit=100)//pass the string and when to break the line, default is 100 characters
_if(lentext(string)<=limit)return string
_.=""
_while(lentext(string)>limit)
__.+=copytext(string,1,limit+1)+"\n"
__string=copytext(string,limit)


There you go! :)
In response to Crashed
Thank You.
In response to Crashed
Crashed wrote:
There's probably some HTML attributes you could use for this, but here's a way of doing it:
(I'm taking TMDI's approach to writing code in the form, each _ is a tab)

Don't ever do that again. If you can't put in an actual tab character, use two or more spaces. The _ and > crap people do is unreadable. Who is this TMDI person? They need to be taught to do this the right way.

Incidentally, your code doesn't find spaces to break at, so it's not very useful.

Lummox JR