Did some work on it, trying not to midify the structure you've used. So far it worked for me, so try it out.
Text$= "Ok the piece of code I need help with is below. Now what I was tring to do was write a function that would take a large paragraph and print out sentences about 65 charectors long without me going and making seperate print statements for each one. However after I got it working I realized that it doesn't take in account that it sometimes splits words between sentences, so... I decided to fix it but instead I have messed it up a bit and got lost. I would appreciate any help or tips. Thanks."
printlines(text$)
wait key
end
function printLines(lines$)
length = len(lines$)
total = 0
while 0 < (length - total)
sentence$ = ""
i = 1
while i < 66 and (i+total)<= len(lines$)
sentence$ = sentence$ + mid$(lines$, i+total)
inc i
`dec length
endwhile
total = total + i
if mid$(sentence$,65) = " "
rem do nothing
else
x = 1
if i>64
do
letter$ = mid$(lines$, total - x)
if letter$= " "
total=total - x
exit
endif
sentence$ = left$(sentence$, len(sentence$)- 1 )
inc x
loop
sentence$ = left$(sentence$, len(sentence$)- 1 )
endif
endif
print sentence$
endwhile
endfunction