There isn't any builtin function that does this, but if it helps, here's one that I wrote.
--Mark
function SplitBlockText(text as String, width as Integer, font as Object) as Object
lines = []
line = 0
while true
while text.Mid(line,1) = " "
line = line + 1
end while
end_line = line
while true
if end_line >= text.Len() then
if end_line > line then lines.Push(text.Mid(line, end_line-line))
return lines
end if
e = EndWord(text, end_line)
if font.GetOneLineWidth(text.Mid(line, e-line), width) >= width then
lines.Push(text.Mid(line, end_line-line))
line = end_line
exit while
end if
end_line = e
end while
end while
end function
function EndWord(text as String, index as Integer) as Integer
for p = index to text.Len()
if text.Mid(p,1) <> " " then exit for
end for
for p = p to text.Len()
if text.Mid(p,1) = " " then exit for
end for
return p
end function