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 <[EMAIL PROTECTED]>

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to