Re: Tcl script fails on some platforms



On 31 jul, 11:06, hrp1...@xxxxxxxxx wrote:
Sorry, I thought I'd done that in the lines -

puts "this is the image filename: $l_image_file"
# If the user picked a file
if {$l_image_file != ""} {
puts "Okay, the image filename wasn't blank"
# add the image to the current session
$::session addImage $l_image_file

addImage is surely the method, and l_image_file is the variable???


You are not setting the ::session variable here, you are referencing
it ($::session)
Add this point the error indicates that $::session is "" so this is
substituted to:

"" addImage $l_image_file

giving the 'invalid command name ""' error.

Maybe you meant ::Session::addImage instead? I did notice that this is
defined as:

body Session::addImage ...

Is body some procedure you wrote yourself?

Mark

.



Relevant Pages

  • Re: Tcl script fails on some platforms
    ... Ah, okay, I think I'm beginning to understand. ... the image filename wasn't blank" ... puts "but the code doesn't seem to have reached here" ... tried on a second machine has the code working fine on the other ...
    (comp.lang.tcl)
  • Re: Tcl script fails on some platforms
    ... puts "Okay, the image filename wasn't blank" ... addImage is surely the method, ...
    (comp.lang.tcl)