Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Unknown macro: {alias}

Name

cmdtrace — Control tcl command tracing

Syntax

cmdtrace on [level]
cmdtrace off
cmdtrace maxblockcount count

Description

The cmdtrace turns on or off tcl command tracing. Traced commands are visible in Geocaps command log window. Enabling command tracing will reduce Tcl performance somewhat, although built-in C++ algorithms are not affected. Don't trace more levels than you need if this is a concern.

You may wish to trace commands only at a given level. A level refers to the level of nested scope in which a command is executed. A toplevel command, executed outside any proc and namespaces, belong to level 1. Commands called from a level 1 command will have level 2, etc.

Arguments

on level

off

maxblockcount count

Examples

The following example show commands at level 1 and level 2.

Commands at different levels

namespace eval myspace {
	variable x 1
}

proc myproc {} {
	puts hello
}

puts "I'm a toplevel command"
myproc

Executing the previous example yields the following output in Geocaps command log. The left-most number indicates the level. Note that proc and namespace are commands like any other in Tcl.

1:namespace eval myspace {
	variable x 1
}
2:variable x 1
1:proc myproc {} {
	puts hello
}
1:puts "I'm a toplevel command"
1:myproc
2:puts hello
  • No labels