# $Header: /home/cvsroot/tcldb/ucodb/Tlib/strFold,v 1.1.1.1 1996/10/12 01:08:25 de Exp $
# tcl procs saved on Sun Sep 03 16:19:05 PDT 1995

proc strFold {str wid} {

# folds a list or space-sep string into lines of width $wid:  brute-force method

        set line ""
        set out {}

        foreach word $str {

                append line "$word "
                if {[clength $line] >= $wid} {
                        lappend out "$line"
                        set line {}
                }

        }

        if {$line != ""} {
        lappend out "$line"
        }

        return "$out"

}

