Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: word wrap
Wrap Text wEdCut() wrapText = ClipGet() wrap=AskLine("WinBatch Studio Text Wrapper","Enter a wrap value.","50") If wrap <= 20 Then wrap = 20 offset = 1 While offset + wrap <= StrLen( wrapText ) If StrLen( wrapText ) < offset + wrap ;See if text line ends within wrap length. offset = offset + StrLen( wrapText ) ;If so, reset the offset to the full file length. Else string = StrSub(wrapText,offset,wrap) ;Get the string defined by the wrap length. findCR = StrIndex(string,@CR,wrap,@BACKSCAN) ;Find a CR in the string or get a 0. findspace = StrIndex(string," ",0,@BACKSCAN) ;Find the last space in the string or get a 0. If findCR > 0 ;If there is a CR, offset = offset + findCR ;set offset to the CR plus one character to ;allow for the LF in the CRLF often used in ;Windows text files. If the LF is not there, ;there is no effect of adding 1 to the offset. Else If findspace > 0 string1 = StrSub( wrapText , 1 , offset + findspace -1 ) ;Insert a CRLF after the space (+1). string2 =StrSub(wrapText,StrLen(string1),StrLen(wrapText)+1-StrLen(string1)) string2 = StrTrim(string2) wrapText = StrCat( string1, @CRLF , string2) drop(string1,string2) offset = offset + findspace + 2 ; Reset the offset to the character after the Tab. Else offset = offset + wrap EndIF EndIf EndIf EndWhile ClipPut(wrapText) Drop(wrapText) wEdPaste()
Article ID: W14107
Filename: Wrap lines to a specific length.txt
File Created: 2000:06:15:11:35:20
Last Updated: 2000:06:15:11:35:20