util_wrap_list (public)
util_wrap_list [ -eol eol ] [ -indent indent ] [ -length length ] \ items
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Wraps text to a particular line length.
- Switches:
- -eol (optional, defaults to
" \"
)- the string to be used at the end of each line.
- -indent (optional, defaults to
"4"
)- the number of spaces to use to indent all lines after the first.
- -length (optional, defaults to
"70"
)- the maximum line length.
- Parameters:
- items (required)
- the list of items to be wrapped. Items are HTML-formatted. An individual item will never be wrapped onto separate lines.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_api_browser_api_describe_function, acs_api_browser_api_proc_documentation
Source code: set out "<pre>" set line_length 0 set line_number 0 foreach item $items { regsub -all -- {<[^>]+>} $item "" item_notags if { $line_length > $indent } { if { $line_length + 1 + [string length $item_notags] > $length } { append out "$eol\n" incr line_number for { set i 0 } { $i < $indent } { incr i } { append out " " } set line_length $indent } else { append out " " incr line_length } } elseif {$line_number == 0} { append out " " } append out $item incr line_length [string length $item_notags] } append out "</pre>" return $outXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql