ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/util.tcl
(Generate patch)

Comparing ray/src/util/util.tcl (file contents):
Revision 2.1 by greg, Thu Oct 27 15:56:12 1994 UTC vs.
Revision 2.4 by greg, Sat Feb 22 02:07:30 2003 UTC

# Line 1 | Line 1
1 < # SCCSid "$SunId$ LBL"
1 > # RCSid: $Id$
2   #
3   # General utility routines
4   #
# Line 10 | Line 10 | proc beep {} {         # ring the bell
10   proc view_txt fn {              # view a text file
11          global env
12          if [info exists env(EDITOR)] {
13 <                eval exec xterm -e $env(EDITOR) $fn
13 >                if {[lsearch -exact {vi vedit view ex edit ed red} \
14 >                                [file tail [lindex $env(EDITOR) 0]]] >= 0} {
15 >                        eval exec xterm +sb -e $env(EDITOR) $fn
16 >                } else {
17 >                        eval exec $env(EDITOR) $fn
18 >                }
19          } else {
20                  foreach f $fn {
21                          exec xedit $f
# Line 28 | Line 33 | proc cardval {var cvl} {       # set variable to one of a se
33                  }
34          }
35          return {} ;             # this would seem to be an error
36 + }
37 +
38 + proc writevars {f vl} {         # write variables to a file
39 +        foreach v $vl {
40 +                upvar $v myv
41 +                if [catch {set il [array names myv]}] {
42 +                        puts $f "set $v [list $myv]"
43 +                } else {
44 +                        foreach i $il {
45 +                                puts $f "set ${v}($i) [list $myv($i)]"
46 +                        }
47 +                }
48 +        }
49   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines