home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sauce 'n' Code 2
/
sauce-n-code-02.adf
/
ASCII_Source
/
WordWrap.asc
< prev
Wrap
Text File
|
1995-07-02
|
722b
|
38 lines
' **********************************
' * Routine to wordwrap text in s$ *
' **********************************
S$="This routine will wordwrap any text found in the variable s$, and will"
S$=S$+" work acording to the amount in ll, which tells it how much characters"
S$=S$+" you wish to have in each line. The finished result will be returned"
S$=S$+" in f$."
LL=38 : Rem amount of characters in line
While Len(S$)>0
L$=Left$(S$,LL)
S$=Mid$(S$,LL+1)
R$=Right$(L$,1)
If R$<>" "
S=Instr(Flip$(L$)," ")
If S>0
R$=Right$(L$,S-1)
S$=R$+S$
L$=Left$(L$,Len(L$)-S)
End If
End If
L$=Left$(L$+Space$(LL),LL)
Print L$
Wend