Pagination use the statistics of the number of words, and then reached a certain number of words on the truncation of output, but the content of the page will be in a baffling place truncated, not very friendly.
Very simply, find the following symbol near the place you want to truncate:
;’”?。!;'".!
If there is a <p> or <br> on the back page. The main is to study the format of the article.
<%
If Request.ServerVariables ("Content_length") > 0 Then
Content = Request.Form ("textarea1")
pagelength = 1000 ' words per page
Clength = Len (content)
PageCount = Int (clength/pagelength) + 1 ' count pages
Dim Pagearray
ReDim Pagearray (PageCount)
Seperator = Array (CHR), Chr (10), ". ","! ","? ","; ",", "," "," "") ' Separator
Pagearray (0) = 0
Pos = 0
For j=0 to UBound (seperator)
Pos = InStr (Pagearray (i) +900,content,seperator (j)) ' Pagearray (i) +900 the location is 100 words, 1-999 adjustable
While Pos > 0 and Pos < (i+1) *pagelength and pos > I*pagelength
Pagearray (i) = Pos
Pos = InStr (Pos+pagelength,content,seperator (J))
Wend
If Pagearray (i) > 0 Then
Response.Write "0:i¦" &pagearray (i) & "<br>" &j& ": J" &seperator (j) & "<br>"
j = j + UBound (seperator) + 1
End If
Next
For I=1 to PageCount-1
Pagearray (i) = 0
Pos = 0
For j=0 to UBound (seperator)
Pos = InStr (Pagearray (I-1) +950,content,seperator (j))
While Pos > 0 and Pos < (i+1) *pagelength and pos > I*pagelength
Pagearray (i) = Pos
Pos = InStr (Pos+pagelength,content,seperator (J))
Wend
If Pagearray (i) > 0 Then
Response.Write i& ": i¦" &pagearray (i) & "<br>" &j& ": J" &seperator (j) & "<br>"
j = j + UBound (seperator) + 1
End If
Next
Next
Output = Mid (Content,1,pagearray (0))
Output = replace (OUTPUT,CHR (), <br>)
Response.Write "<br><br> 1th paragraph <br>"
Response.Write Output
For I=1 to PageCount-2
Output = Mid (Content,pagearray (i-1) +1,pagearray (i)-pagearray (i-1))
Output = replace (OUTPUT,CHR (), <br>)
Response.Write "<br><br> section" &i+1& "paragraph <br>"
Response.Write Output
Next
' The last section of the output is not written.
Else
%>
<form action= "" Method=post id=form1 name=form1>
<textarea rows=70 cols=120 id=textarea1 name=textarea1>
</TEXTAREA>
<input type= "Submit" value= "Submit" Id=submit1 name=submit1>
</FORM>
<%end if%>