[GRASS-dev] select issue with wingrass

Glynn Clements glynn at gclements.plus.com
Sun Nov 18 12:27:45 EST 2007


Michael Barton wrote:

> >>> I have advanced a little bit trying to debug this, although I have no idea
> >>> why this has suddenly appeared and wasn't there all the time, and I'm,
> >>> therefore, not sure that this is really the origin of the problem.
> >>> 
> >>> select.tcl uses both the GISDBASE and MAPSET env variables.
> >> 
> >> They aren't supposed to be environment variables.
> >> 
> >> I'm surprised that select.tcl has worked so far. It should be using
> >> g.gisenv to get those values.
> > 
> > Ah; the reason it's been working so far is that both lib/gis/gui.tcl
> > and gui/tcltk/gis.m/gm.tcl set them, e.g.:
> > 
> > if {[catch {set env(GISDBASE) [exec g.gisenv get=GISDBASE]} error]} {
> > 
> > Any other code which uses select.tcl will need to do likewise.
> > 
> > Use of env() is less than ideal (there's already enough confusion
> > between GRASS variables and environment variables), but using separate
> > variables would require changing a lot of "global" statements.
> 
> If this is set in gui.tcl (the first thing run by the GRASS TclTk gui),
> won't it then be available to all other gui modules?
> 
> That is, why can't select.tcl access GISBASE if env(GISBASE) is set in
> gui.tcl?

If the array element isn't set, or if "global env" is missing, you
would get an error from Tcl. That doesn't appear to be the case here.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list