• global on single var broken; use array if you want globals (my interp p

    From Conor Williams@21:1/5 to All on Mon Oct 11 17:05:21 2021
    array set timerArr { eeit 0 timeVar 73 stop 0}
    frame .frame1; pack .frame1 -side left; frame .frame2; pack .frame2 -side right;
    button .frame1.display -width 8; pack .frame1.display
    button .frame1.bzeroms -command "zeroms" -text "zeroms"; pack .frame1.bzeroms button .frame2.pause -command "pause" -text "pause"; pack .frame2.pause
    button .frame2.quit -command "eeit" -text "quit" ; pack .frame2.quit;
    set blah [expr 1+0+7]
    proc zeroms {} {global timerArr; set timerArr(timeVar) 4;}
    proc eeit {} {global timerArr; set timerArr(eeit) 1;}
    proc pause {} { global timerArr; if {$timerArr(stop) == 0} {
    set timerArr(stop) 1;} elseif {$timerArr(stop) == 1} {set timerArr(stop) 0}}
    while {1 == 1} {
    if {$timerArr(stop) == 0} {
    set a $timerArr(timeVar); incr a; .frame1.display configure -text $a;
    set timerArr(timeVar) $a;}
    set timerArr(timeVar) $timerArr(timeVar); after 998; update;
    if {$timerArr(eeit) == 1} {set timerArr(eeit) 1; exit 0;}
    }
    #on dual core 1550 1d /c:en#eof

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerald Lester@21:1/5 to Conor Williams on Tue Oct 12 07:33:12 2021
    On 10/11/21 7:05 PM, Conor Williams wrote:
    array set timerArr { eeit 0 timeVar 73 stop 0}
    frame .frame1; pack .frame1 -side left; frame .frame2; pack .frame2 -side right;
    button .frame1.display -width 8; pack .frame1.display
    button .frame1.bzeroms -command "zeroms" -text "zeroms"; pack .frame1.bzeroms button .frame2.pause -command "pause" -text "pause"; pack .frame2.pause button .frame2.quit -command "eeit" -text "quit" ; pack .frame2.quit;
    set blah [expr 1+0+7]
    proc zeroms {} {global timerArr; set timerArr(timeVar) 4;}
    proc eeit {} {global timerArr; set timerArr(eeit) 1;}
    proc pause {} { global timerArr; if {$timerArr(stop) == 0} {
    set timerArr(stop) 1;} elseif {$timerArr(stop) == 1} {set timerArr(stop) 0}}
    while {1 == 1} {
    if {$timerArr(stop) == 0} {
    set a $timerArr(timeVar); incr a; .frame1.display configure -text $a;
    set timerArr(timeVar) $a;}
    set timerArr(timeVar) $timerArr(timeVar); after 998; update;
    if {$timerArr(eeit) == 1} {set timerArr(eeit) 1; exit 0;}
    }
    #on dual core 1550 1d /c:en#eof


    Dude,

    Tell us what you are seeing.
    Tell us what you are expecting.

    And tell us why in the world you have a "while true" -- that should be
    done in your C code.

    Suggestion: you may want to invert your process and make your C an
    extension that a Tcl script calls instead of the C "driving" the Tcl/Tk.

    --
    +----------------------------------------------------------------------+
    | Gerald W. Lester, President, KNG Consulting LLC |
    | Email: Gerald.Lester@kng-consulting.net | +----------------------------------------------------------------------+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Conor Williams@21:1/5 to Gerald Lester on Thu Oct 14 12:04:30 2021
    Gerald - you do realise that tclsh is multi-threaded? /c:20211410

    On Tuesday, October 12, 2021 at 12:33:25 PM UTC, Gerald Lester wrote:
    On 10/11/21 7:05 PM, Conor Williams wrote:
    array set timerArr { eeit 0 timeVar 73 stop 0}
    frame .frame1; pack .frame1 -side left; frame .frame2; pack .frame2 -side right;
    button .frame1.display -width 8; pack .frame1.display
    button .frame1.bzeroms -command "zeroms" -text "zeroms"; pack .frame1.bzeroms
    button .frame2.pause -command "pause" -text "pause"; pack .frame2.pause button .frame2.quit -command "eeit" -text "quit" ; pack .frame2.quit;
    set blah [expr 1+0+7]
    proc zeroms {} {global timerArr; set timerArr(timeVar) 4;}
    proc eeit {} {global timerArr; set timerArr(eeit) 1;}
    proc pause {} { global timerArr; if {$timerArr(stop) == 0} {
    set timerArr(stop) 1;} elseif {$timerArr(stop) == 1} {set timerArr(stop) 0}}
    while {1 == 1} {
    if {$timerArr(stop) == 0} {
    set a $timerArr(timeVar); incr a; .frame1.display configure -text $a;
    set timerArr(timeVar) $a;}
    set timerArr(timeVar) $timerArr(timeVar); after 998; update;
    if {$timerArr(eeit) == 1} {set timerArr(eeit) 1; exit 0;}
    }
    #on dual core 1550 1d /c:en#eof

    Dude,

    Tell us what you are seeing.
    Tell us what you are expecting.

    And tell us why in the world you have a "while true" -- that should be
    done in your C code.

    Suggestion: you may want to invert your process and make your C an
    extension that a Tcl script calls instead of the C "driving" the Tcl/Tk.

    --
    +----------------------------------------------------------------------+
    | Gerald W. Lester, President, KNG Consulting LLC |
    | Email: Gerald...@kng-consulting.net | +----------------------------------------------------------------------+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Conor Williams@21:1/5 to Conor Williams on Thu Oct 14 12:11:11 2021
    and also wi-sh (... is multiThreaded...) do you know what that doth mean Gerald Lester? /c:202114102000063.9m

    On Thursday, October 14, 2021 at 7:04:33 PM UTC, Conor Williams wrote:
    Gerald - you do realise that tclsh is multi-threaded? /c:20211410
    On Tuesday, October 12, 2021 at 12:33:25 PM UTC, Gerald Lester wrote:
    On 10/11/21 7:05 PM, Conor Williams wrote:
    array set timerArr { eeit 0 timeVar 73 stop 0}
    frame .frame1; pack .frame1 -side left; frame .frame2; pack .frame2 -side right;
    button .frame1.display -width 8; pack .frame1.display
    button .frame1.bzeroms -command "zeroms" -text "zeroms"; pack .frame1.bzeroms
    button .frame2.pause -command "pause" -text "pause"; pack .frame2.pause button .frame2.quit -command "eeit" -text "quit" ; pack .frame2.quit;
    set blah [expr 1+0+7]
    proc zeroms {} {global timerArr; set timerArr(timeVar) 4;}
    proc eeit {} {global timerArr; set timerArr(eeit) 1;}
    proc pause {} { global timerArr; if {$timerArr(stop) == 0} {
    set timerArr(stop) 1;} elseif {$timerArr(stop) == 1} {set timerArr(stop) 0}}
    while {1 == 1} {
    if {$timerArr(stop) == 0} {
    set a $timerArr(timeVar); incr a; .frame1.display configure -text $a;
    set timerArr(timeVar) $a;}
    set timerArr(timeVar) $timerArr(timeVar); after 998; update;
    if {$timerArr(eeit) == 1} {set timerArr(eeit) 1; exit 0;}
    }
    #on dual core 1550 1d /c:en#eof

    Dude,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)