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):
%3 test_acs_api_browser_api_describe_function acs_api_browser_api_describe_function (test acs-api-browser) util_wrap_list util_wrap_list test_acs_api_browser_api_describe_function->util_wrap_list test_acs_api_browser_api_proc_documentation acs_api_browser_api_proc_documentation (test acs-api-browser) test_acs_api_browser_api_proc_documentation->util_wrap_list api_proc_documentation api_proc_documentation (public) api_proc_documentation->util_wrap_list

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 $out
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: