Reference | function | A long English with no spaces in it, the system thinks it is a word and does not automatically wrap to keep the word intact. In fact, this situation can not be dealt with, because in the actual application in addition to testing or some trouble will not occur, but in order to just in case, I wrote the following function a few months ago, is only a stopgap, in order to deal with the malicious spoilers.
'-------------------------------------------------
'
' Function name:autowrap
'
'
' Description: Solve the problem of not automatically wrapping in long English
'
' Parameters:a_strsourcestring: The source string to convert
'
' A_intsize, Width per line
'
' Author:bigeagle
'
' Date:2000/4/17
'
' History:2000/4/17:version 1.0
'
'-------------------------------------------------------
function AutoWrap (a_strsourcestring, A_intsize)
Dim l_strdeststring
' Exit if there is a carriage return in the content
' If InStr (A_strsourcestring, Chr () + CHR ()) <> 0 Then
' AutoWrap = replace (a_strsourcestring, Chr () + CHR (), <br>)
' Exit function
' End If
' Check if valid parameters
Call Assert (VarType (a_strsourcestring) = 8, "AutoWrap", "a_strsourcestring must to be a string")
Call Assert (VarType (a_intsize) = 2, "AutoWrap", "a_intsize must to be an integer")
Dim i
If A_intsize >= len (a_strsourcestring) Then
l_strdeststring = a_strsourcestring
Else
' l_strdeststring = Left (a_strsourcestring, a_intsize)
For i = 1 to len (a_strsourcestring) Step a_intsize
If InStr (I, Mid (a_strsourcestring, I, a_intsize), Chr (32)) = 0 _
or InStr (I, Mid (a_strsourcestring, I, a_intsize), Chr (a) +CHR) then
l_strdeststring = l_strdeststring + "" + Mid (a_strsourcestring, i + 1, a_intsize)
Else
l_strdeststring = l_strdeststring + mid (a_strsourcestring, i + 1, a_intsize)
End If
Next
End If
Call Print ("[Autowrap:]return value is: '" + l_strdeststring + "")
l_strdeststring = replace (l_strdeststring, Chr () + CHR (), <br>)
AutoWrap = l_strdeststring
End Function