0023348: Expression 'ii >= 0' is always true. Unsigned type value is always >= 0.
[occt.git] / src / DrawResources / StandardCommands.tcl
index 45a72fb..1d16b4b 100755 (executable)
@@ -96,17 +96,16 @@ proc getsourcefile {{command ""}} {
 
     global Draw_Helps Draw_Groups Draw_Files
 
+    set out {}
     if {$command == ""} {
 
        # help general
        foreach h [lsort [array names Draw_Groups]] {
-           puts ""
-           puts ""
-           puts $h
+           lappend out "" "" "$h"
            set i 0
            foreach f [lsort $Draw_Groups($h)] {
                if {$i == 0} {
-                   puts "  "
+                   lappend out ""
                }
                incr i
 #
@@ -114,18 +113,7 @@ proc getsourcefile {{command ""}} {
 #
                foreach command_that_has_file [array names Draw_Files] {
                    if {($command_that_has_file == $f)} {
-#
-#  compute the length of the string to have the right spacing
-#  with tabs
-#
-                       set ll [string length $f] 
-                       if {($ll >= 1) && ($ll < 8)} {
-                           puts "$f\t\t:  $Draw_Files($f) "
-                       }
-                       if {($ll >= 8)} {
-                           puts "$f\t:  $Draw_Files($f) "
-                       }
-                        
+                       lappend out [format {%-20s %s} $f $Draw_Files($f)]
                    }
                }
            }
@@ -136,17 +124,12 @@ proc getsourcefile {{command ""}} {
        append command "*"
        foreach f [lsort [array names Draw_Files]] {
            if {[string match $command $f]} {
-               puts -nonewline $f
-               for {set j [string length $f]} {$j < 15} {incr j} {
-                   puts -nonewline " "
-               }
-
-               puts "     $Draw_Files($f)"
+                lappend out [format {%-20s %s} $f $Draw_Files($f)]
            }
        }
        
     } 
-    flush stdout
+    return [join $out "\n"]
 }
 
 help getsourcefile {getsourcefile, or getsourcefile command } {DRAW General Commands}