' *** WRAPWORD.LST *** 2nd GFA-Manual, page 9-10 > PROCEDURE wrap_word(column,line,width,text$) ' ' *** Print text$ at (column&,line&) using columns of width& characters ' *** If text is longer than width&, rest of text is printed on next line(s) ' LOCAL space,hyphen,pos,m$,k WHILE LEN(text$)>width space=RINSTR(text$," ",width+2) ! 1 more due to RINSTR-bug hyphen=RINSTR(text$,"-",width+1) ! again IF space>hyphen PRINT AT(column,line);LEFT$(text$,space-1) text$=MID$(text$,space+1) INC line ELSE IF hyphen PRINT AT(column,line);LEFT$(text$,hyphen) text$=MID$(text$,hyphen+1) INC line ELSE m$=" *** Error ***|Procedure Wrap_word can't find|space or hyphen" m$=m$+" in line that |is wider than "+STR$(width)+" characters" ALERT 2,m$,1,"EDIT",k EDIT ENDIF WEND pos=LEN(text$) PRINT AT(column,line);LEFT$(text$,pos) RETURN ' ********* '