Hello out there,
I am using TKCon a lot e.g. by using its debug feature 'idebug'. But sometimes I want to have a script run by itself or under a different
debugger - and then I want to replace the 'idebug' proc by a 'do
nothing' dummy.
Looking at TKCon's sources I see that it creates a namespace 'tkcon' -
but looking for that namespace leads to nothing, as evidenced by the following dump rigth from a start of TKCon:
----
loading history file ... 40 events added
buffer line limit: 512 max line length: unlimited
Main console display active (Tcl8.6.10 / Tk8.6.10)
(GUI) 41 % lsort [namespace children]
::baltip ::nsf ::oo ::pkg ::poImgUtil ::tcl ::tkpath ::twapi ::zlib
(GUI) 42 % lsort [namespace children ::]
::baltip ::nsf ::oo ::pkg ::poImgUtil ::tcl ::tkpath ::twapi ::zlib
(GUI) 43 %
----
So what is a way to find out what I want?
I'm running TKCon 2.7 under Tcl8.10 on Windows 10.
Any help will be greatly appreciated
Helmut
Hello out there,
I am using TKCon a lot e.g. by using its debug feature 'idebug'. But sometimes I want to have a script run by itself or under a different
debugger - and then I want to replace the 'idebug' proc by a 'do
nothing' dummy.
Looking at TKCon's sources I see that it creates a namespace 'tkcon' -
but looking for that namespace leads to nothing, as evidenced by the following dump rigth from a start of TKCon:
----
loading history file ... 40 events added
buffer line limit: 512 max line length: unlimited
Main console display active (Tcl8.6.10 / Tk8.6.10)
(GUI) 41 % lsort [namespace children]
::baltip ::nsf ::oo ::pkg ::poImgUtil ::tcl ::tkpath ::twapi ::zlib
(GUI) 42 % lsort [namespace children ::]
::baltip ::nsf ::oo ::pkg ::poImgUtil ::tcl ::tkpath ::twapi ::zlib
(GUI) 43 %
----
So what is a way to find out what I want?
I'm running TKCon 2.7 under Tcl8.10 on Windows 10.
Any help will be greatly appreciated
Helmut
Parsing your message is difficult for me because I am slow to pickthanks for the attempt, but I want to know whether my script is
certain things up, but in your place I would have the script set
some variable right in the beginning then unset that variable whenever
it exits, before it exits of course.
Then you can always check if that variable exists. If it does, the
script is running.
Would this help:
if {"tkcon" in [interp aliases]} "puts yes"
This outputs a yes if I'm running with tkcon, otherwise
not. My tkcon is from magicsplat's install on windows.
Hi et99,
your're the greatest :)
Would this help:This is exactly an answer to my problem.
if {"tkcon" in [interp aliases]} "puts yes"
This outputs a yes if I'm running with tkcon, otherwise
not. My tkcon is from magicsplat's install on windows.
May I ask how you happen to know this?
Many thanks to you
Helmut
I think you can also use [info command tkcon] as well.
On Wed, 24 May 2023 10:46:54 -0700, et99 wrote:
I think you can also use [info command tkcon] as well.
So I decided to run [info command tkcon] on Tkcon for the heck of it
and the output was 'tkcon.'
On 5/24/2023 1:23 PM, Luc wrote:https://core.tcl-lang.org/tips/doc/trunk/tip/426.md
On Wed, 24 May 2023 10:46:54 -0700, et99 wrote:
I think you can also use [info command tkcon] as well.
Hi et99,
I knew that each interpreter gets it's own set of namespaces,whow, that is really smart. As I said earlier: Your're the greatest
globals, etc. and if you weren't able to see any tkcon
namespaces, yet you saw them creating one in the source code,
I figured that was why.
So, I looked at the manual entry on interp and tried a few of
the introspection commands until I found one that was
different when running under tkcon.
:)
Thanks again
Helmut
I knew that each interpreter gets it's own set of namespaces,whow, that is really smart. As I said earlier: Your're the greatest
globals, etc. and if you weren't able to see any tkcon
namespaces, yet you saw them creating one in the source code,
I figured that was why.
So, I looked at the manual entry on interp and tried a few of
the introspection commands until I found one that was
different when running under tkcon.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 11:56:17 |
| Calls: | 12,100 |
| Files: | 15,003 |
| Messages: | 6,517,995 |