[GRASS-dev] Re: gis.m crashes on zoom to map existing in more than one mapset

Moritz Lennert mlennert at club.worldonline.be
Thu Jan 4 16:18:41 EST 2007


On Thu, January 4, 2007 21:35, Michael Barton wrote:
> Paul
>
>
> On 1/4/07 9:42 AM, "Paul Kelly" <paul-grass at stjohnspoint.co.uk> wrote:
>
>> Hello Michael
>>
>> On Thu, 4 Jan 2007, Michael Barton wrote:
>>
>>> On 1/4/07 8:47 AM, "Moritz Lennert" <mlennert at club.worldonline.be>
>>> wrote:
>>>
>>> Moritz and Paul,
>>>
>>> The following construction will trap errors in TclTk, but it doesn't
>>> help
>>> this particular issue.
>>>
>>>    if {![catch {open [concat "|g.region" "-ugp" $args] r} input]} {
>>>        while {[gets $input line] >= 0} {
>>>            regexp -nocase {^([a-z]+)=(.*)$} $line trash key value
>>>            set parts($key) $value
>>>        }
>>> ....
>>>
>>> If there if no error, "catch" returns 0 and the routine goes on.
>>> If there is an error, "catch" returns a value >0 and the error message
>>> is
>>> stored in the variable "input". Input can be printed to the terminal or
>>> to a
>>> TclTk dialog if desired.
>>
>> Try this instead:
>>      if {![catch {open [concat "|g.region" "-ugp" $args "|&
>> $env(GISBASE)/etc/grocat"] r} input]} {
>>          while {[gets $input line] >= 0} {
>>              if { [regexp -nocase {^([a-z]+)=(.*)$} $line trash key
>> value] }
>>              {
>> set parts($key) $value
>>              }
>>          }
>
> I can confirm that this works. What is grocat??

A small program that Paul wrote. Here's the description from the source file:

* PURPOSE:      Copies stdin to stdout in line-buffered mode until end
*               of file is received.
*               Used with Tcl/Tk gronsole system to merge stdout and
*               stderr streams to be caught by Tcl "open" command.


>
> OK. If you've tested this on Windows, then it should be OK. I'm just
> trying
> not to do anything that will jeopardize a native Windows build.

I think as the main developer working on the Win port we can trust Paul to
have the same worries ;-)

Moritz




More information about the grass-dev mailing list