
can't read env(DISPLAY) from regexp with $env(DISPLAY)
You need to have env in global scope. It might also help to
put your regular expression inside {}.
proc getlocalxdisplay { } {
global env
regexp {(.*):(.*)} $env(DISPLAY) ignore localhost displaynum
...
Hope this helps.
Will
Quote:
>proc getlocalxdisplay { } {
># get the current DISPLAY and parse it
> regexp (.*):(.*) $env(DISPLAY) ignore localhost displaynum
> if { [string compare $localhost ""] == 1} {
># that is to say, if the local DISPLAY returns :0
># localhost will come up null
># which means that the user is on a 250
>#
># domainname is essentially the proc by the same name from THE BOOK
>#
> set nodename [ exec hostname ]
> set xdisplay "$nodename.[domainname]:$displaynum"
> } else {
> set xdisplay $env(DISPLAY)
> }
> return $xdisplay
>}
--
# Copyright 1997 Will Morse. Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
# Gravity, # Will Morse
# not just a good idea, # Houston, Texas
#
# These are my views and do not necessarly reflect anyone else/
=========================================================================
By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
meets the definition of a telephone fax machine. By Sec.227(b)
(1)(C), it is unlawful to send any unsolicited adverti{*filter*}t to
such equipment, punishable by action to recover actual monetary
loss, or $500, whichever is greater, for EACH violation.
=========================================================================