[GRASS-dev] ganim troubles in latest cvs

Glynn Clements glynn at gclements.plus.com
Mon Oct 1 14:20:30 EDT 2007


Kirk Wythers 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"]

No, before it:

	set reglist [split $region "\n"]
	foreach line $reglist {
		...

Or just omit the variable altogether:

	foreach line [split $region "\n"] {
		...


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




More information about the grass-dev mailing list