SIMPOL Documentation

formatlinebreaks()

Description

This function processes the incoming text and rewrites it to fit certain requirements, such as being indented a certain amount and having lines of a certain maximum length. It is commonly used to reformat content for pretty printers or when converting from one format to another or when outputting some results into a text-based format.

[Note]Note

It is important to realize that this code will not remove existing line breaks, only break lines that are too long. To use this code to reformat existing text, remove all line breaks from the input first!

Prototype

formatlinebreaks ( string sIndent, string sOrig, integer iLinewidth, string sEOL, boolean preservewhitespace, boolean skipindentonfirstline )

Parameters

ParameterDefault valueType nameDescription
sIndentNonestring
sOrigNonestring
iLinewidthNoneinteger
sEOL string
preservewhitespace.falseboolean
skipindentonfirstline.falseboolean