This function helps me a great deal, please note it is not my code, i found it on the codebase, but i cant remember for the life of me who wrote it, but its very helpful.
function wText(x#, y#, s$, length#)
if len(s$) < length#
text x#, y#, s$
s$=""
endif
space_count=length#
wcount=1
while len(s$) > length#
wtextT$ = left$(s$, length#)
rem New piece of code to check where the last space exists in the current line. The length# value is replaced from this point
rem with a new value that takes away the number of characters back to the previous word. This removes words being split at the end of a line.
for f = space_count to 1 step -1
if mid$(wtextT$,f)=" " then space_count=space_count-(space_count-f):goto skip9
next f
skip9:
wtextT$ = left$(s$, space_count)
s$ = right$(s$, len(s$)-space_count)
text x#, y#+text height(s$)*wcount, wTextT$
wcount=wcount+1
space_count=length#
endwhile
text x#, y#+text height(s$)*wcount, s$
x#=0
y#=0
s$=""
length#=0
endfunction
Omricon W.I.P