Действительно полезный код, но я использую его для динамических строк
- Код: Выделить всё
Function WordBreakString (szIn As String, szOut As String, ByVal MaxLineLength As Long) As Long
' breaks up szIn into LF =terminated strings not larger than maxLineLength
' returns: # of LF-terminated strings szOut
Local Stat As Long, I As Long, J As Long
Local inLEn As Long
Local LenSzOut As Long
Local pIN As String Ptr * 1, pOut As String Ptr * 1
Local LineBReak As Long, LineLength As Long
'!!! pIn = VarPtr (szIn)
pIn = StrPtr (szIn)
'!!!pOut = VarPtr (szOut)
pOut = StrPtr (szOut)
inLEn = Len (szIn)
'!!! Буфер на длинну исходной строки + *прогнозируемое кол-во "$LF"
szOut = Space$(inLEn + inLEn \ MaxLineLength)
'!!!
... дальше без изменений