[GRASS-dev] ganim troubles in latest cvs
Kirk Wythers
kwythers at umn.edu
Mon Oct 1 13:35:19 EDT 2007
On Oct 1, 2007, at 11:15 AM, Glynn Clements wrote:
>
> Kirk Wythers wrote:
>
>>
>> On Sep 30, 2007, at 11:23 PM, Michael Barton wrote:
>>
>>> Well, after asking for help, I figured out how to this without the
>>> dread
>>> regexp ;-). This might even be a bit better routine.
>>>
>>> Anyway, I can't commit this because I'm out of town, but if anyone
>>> wants to
>>> try it, you need to change lines in procedure GmAnim::main (module
>>> animate.tcl). Replace the commented lines with the uncommented
>>> lines below.
>>>
>>> foreach line $reglist {
>>> set line [string trim $line]
>>> set key [lindex [split $line "="] 0]
>>> switch $key {
>>> nsres {set oldres1 [lindex [split $line "="] 1]}
>>> ewres {set oldres2 [lindex [split $line "="] 1]}
>>> rows {set vrows [lindex [split $line "="] 1]}
>>> cols {set vcols [lindex [split $line "="] 1]}
>>> }
>>>
>>> }
>>>
>>> # regexp {nsres= *([0-9]+)} $region dummy oldres1
>>> # regexp {ewres= *([0-9]+)} $region dummy oldres2
>>> # regexp {rows= *([0-9]+)} $region dummy vrows
>>> # regexp {cols= *([0-9]+)} $region dummy vcols
>
> Add:
> set reglist [split $region "\n"]
In the foreach loop, like this?
foreach line $reglist {
set reglist [split $region "\n"]
set line [string trim $line]
set key [lindex [split $line "="] 0]
switch $key {
nsres {set oldres1 [lindex [split $line "="] 1]}
ewres {set oldres2 [lindex [split $line "="] 1]}
rows {set vrows [lindex [split $line "="] 1]}
cols {set vcols [lindex [split $line "="] 1]}
}
}
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
More information about the grass-dev
mailing list