[GRASS-dev] Re: [GRASS-CVS] michael: grass6/gui/tcltk/gis.m mapcanvas.tcl, 1.52, 1.53

Michael Barton michael.barton at asu.edu
Tue Nov 28 23:22:00 EST 2006

On 11/28/06 6:58 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:

> I changed:
> - if {![catch {open [concat "|g.region" "-ug" $args] r} input]} {
> + set regcmd [concat "|g.region" "-ug" $args]
> + set retval [catch {open $regcmd r} input]
> + if {! $retval } {

I think this is problematic. The original code says in essence, if g.region
does *not* fail, do the following.

Looking at the catch command, it should store any error returned in the
variable input.

Trying replacing the line in the else clause...

puts "GRASS command g.region failed. Check to see if you've install GRASS


puts $input

When I rename g.region to g.region_x, this produces the following error
message on the command line...

couldn't execute "g.region": no such file or directory

How's this?


Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

More information about the grass-dev mailing list