Just rebuilt with:

   # 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

    set reglist [split $region "\n"]

    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]}
        }

    }


Here is the new error (upon starting GmAnim):

invalid command name "Proc"
invalid command name "Proc"
    while executing
"Proc GmAnim::do_run {} {
# procedure that displays maps in an animation and controls the animation
    global loop
    global swing
    global a..."
(file "/Applications/GRASS-6.3.app/Contents/MacOS/etc/gm/ animate.tcl" line 635)
    invoked from within
"source /Applications/GRASS-6.3.app/Contents/MacOS/etc/gm/animate.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: $auto_index($name)"
    (procedure "auto_load" line 13)
    invoked from within
"auto_load $name [uplevel 1 {::namespace current}]"
    (autoloading "GmAnim::main")
    invoked from within
"GmAnim::main"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 $cmd"
    (procedure "Button::_release" line 18)
    invoked from within
"Button::_release .mainframe.topf.tb1.bbox4.b0"
    (command bound to event)


On Oct 1, 2007, at 9:17 PM, Michael Barton wrote:

Kirk,

You seem to be missing a line (maybe my fault). Note the line defining
reglist.


Michael
=====================================

    set reglist [split $region "\n"]

    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]}
        }

    }



On 10/1/07 6:36 AM, "Kirk Wythers" <[EMAIL PROTECTED]> 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



Michael,

Thanks for the email. I made the following changes but ended up with
a new error. I might have altered the wrong file. Here is what I tried.

 From the file ~/src_intel/grass-6.3.cvs/gui/tcltk/gis.m/animate.tcl

     # set initial canvas geometry to match region
     if {[catch {set region [exec g.region -ugp]} error]} {
         Gm::errmsg $error
     }

    # 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

     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]}
         }

     }

New error when startring up GmAnim.

can't read "reglist": no such variable
can't read "reglist": no such variable
     while executing
"foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres    {..."
     (procedure "GmAnim::main" line 28)
     invoked from within
"GmAnim::main"
     ("uplevel" body line 1)
     invoked from within
"uplevel \#0 $cmd"
     (procedure "Button::_release" line 18)
     invoked from within
"Button::_release .mainframe.topf.tb1.bbox4.b0"
     (command bound to event)

Perhaps this is not what you intended?

Kirk






__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
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



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

Reply via email to