| 1 |
greg |
2.1 |
# SCCSid "$SunId$ LBL"
|
| 2 |
|
|
#
|
| 3 |
|
|
# General utility routines
|
| 4 |
|
|
#
|
| 5 |
|
|
|
| 6 |
|
|
proc beep {} { # ring the bell
|
| 7 |
|
|
puts -nonewline stderr "\a"
|
| 8 |
|
|
}
|
| 9 |
|
|
|
| 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
|
| 14 |
|
|
} else {
|
| 15 |
|
|
foreach f $fn {
|
| 16 |
|
|
exec xedit $f
|
| 17 |
|
|
}
|
| 18 |
|
|
}
|
| 19 |
|
|
}
|
| 20 |
|
|
|
| 21 |
|
|
proc cardval {var cvl} { # set variable to one of a set of values
|
| 22 |
|
|
upvar $var v
|
| 23 |
|
|
set tv [string toupper $v]
|
| 24 |
|
|
foreach cv $cvl {
|
| 25 |
|
|
if {[string first $tv [string toupper $cv]] == 0} {
|
| 26 |
|
|
set v $cv
|
| 27 |
|
|
return $cv
|
| 28 |
|
|
}
|
| 29 |
|
|
}
|
| 30 |
|
|
return {} ; # this would seem to be an error
|
| 31 |
|
|
}
|