if you look at my windows system, you can see a part of my code can cut a text between words (you don't have to add a special letter, it's automatic)
You just have to modify my code (look for the lines which draw the text of a label) to make a function like yours
http://forum.thegamecreators.com/?m=forum_view&t=35493&b=6
edit>
Here's the code that cut the text
if text width(gadget(gg).chaine)>gadget(gg).width
var$ = gadget(gg).chaine
var2 = -text height("|")
repeat
var = 0
repeat
inc var
until text width(left$(var$, var+1))>gadget(gg).width or var >=len(var$)
if text width(left$(var$, var+1))>gadget(gg).width
while var < len(var$) and var > 0.6*gadget(gg).width/text width("_") and mid$(var$, var)<>" "
dec var
endwhile
endif
inc var2, text height("|")
text window(t).x+gadget(gg).x, var2+window(t).y+gadget(gg).y, left$(var$, var)
var$ = right$(var$, len(var$)-var)
until var$=""
else
text window(t).x+gadget(gg).x, window(t).y+gadget(gg).y, gadget(gg).chaine
endif
As you can see, it isn't very long
gadget().x => position x
gadget().y => position y
gadget().width => width of the text
gadget().chaine => string of the gadget
In some cases, my way to cut the text may be better than yours, but in some others, yours is better => you could also mix them
The sleeper must awaken !