Re: 'console show' gone on Win98 ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: 'console show' gone on Win98 ?

From: Helmut Giese <hgiese@ratiosoft.com>
Date: Fri Dec 23 2005 - 17:25:48 CET

On 22 Dec 2005 15:30:59 -0800, krithiga81@yahoo.com wrote:

>Hi
> The example you showed works fine.
> When I have a procedure in my code for eg
>
>proc read_product_config {} {
>
> set prodcfg trav_product.cfg
> puts "I am reading product config file"
> }
>
>If I have this the "puts" inside the proc,it does not get put in the
>console. If I use puts outside a procedure it works
>
>So I commented out the proc to check if variables in my code worked.
>Then I can debug. Is it because the proc needs to be called?
>I tried that also. Does not work

Hi krithiga,
if the example below works for you (it does for me), maybe you can use
it as a base for experimenting: just try to add a little bit of the
functionality you need into this skeleton.
If this works: fine, continue.
If it doesn't: Show the complete example (therefor: try to keep it
small) and we'll probably be able to figure out what's going wrong.
HTH
Helmut Giese
        --- file constst.tcl ---
package require Tk

# If started as 'tclsh constst.tcl' this line appears
# in the "DOS" console, else (if started by a double click)
# it shows up in Tk's console.
puts "Program starts."

source console.tcl

# this appears in the console
puts "This message should show up in a console window."

set btn1 [button .b1 -text "Click me" -command [list show 1]]
set btn2 [button .b2 -text "Click me" -command [list show 2]]
pack $btn1 $btn2

proc show {which} {
    puts "You clicked button $which."
}
        ---
Received on Fri Dec 23 19:03:14 2005