I am trying to print the name of the current executable using the
following statment:
puts "\n $argv0"
However, I get the following error message & the program exits:
can't read "argv0": no such variable
I tried using "global argv0" at the beginning of the proc too but that
doesn't help.
Is there anything else that I should watch out for?
Thanks,
Ashok
> can't read "argv0": no such variable
>
> I tried using "global argv0" at the beginning of the proc too but that
> doesn't help.
That is the answer, so it should work. Are you sure you didn't have
a typo?
--
Donald Arseneau as...@triumf.ca
> However, I get the following error message & the program exits:
>
> can't read "argv0": no such variable
>
> I tried using "global argv0" at the beginning of the proc too but that
> doesn't help.
>
> Is there anything else that I should watch out for?
Are you using a "stock" tclsh? What does:
puts [lsort [info globals]]
show in your environment?
Michael
Thanks for all your suggestions.
Here's how I solved the issue. I used "set program_name [ info
nameofexecutable ]" & the name of the program preceded by the path gets
printed.
Regards,
Ashok