' *** CNTR_TXT.LST *** 2nd GFA-Manual, page 9-9 > PROCEDURE center(line,width,text$) ' ' *** Center text$ on screen, starting at line& ' *** Text will be printed in columns of width& characters ' *** If text is longer than width&, rest of text is printed on next line(s) ' ' *** Standard: col.max& ' LOCAL column,space,hyphen,pos,m$,k column=(col.max-width)/2 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+(width-space+1)/2,line);LEFT$(text$,space-1) text$=MID$(text$,space+1) INC line ELSE IF hyphen PRINT AT(column+(width-hyphen)/2,line);LEFT$(text$,hyphen) text$=MID$(text$,hyphen+1) INC line ELSE m$=" *** Error ***|Procedure Center 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+(width-pos)/2,line);LEFT$(text$,pos) RETURN ' ********* '