09-27-2007
Help with Tcl...
Hello Tcl Experts,
set i 0
while { $i < 10 } {
puts "$i"
incr i
}
I am trying to print the value of "i" at the same place. i.e. it should first print "1", then in next iteration print "2" over the location of "1" and so on.... (i.e. in every iteration, delete the previous number and print the next number at the same place)...
I tried various combinations of switches(blindly), but couldn't make it work.. The next value is always printed in new line...
Present Output:
0
1
2
3
4
5
6
7
8
9
I want:
9
or atleast
1 2 3 4 5 6 7 8 9
I hope I am able to make myself clear.
Thanks...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
can someone tell my why the puts is not reflecting the variable?
CUT -->
set fp
while {-1 != } {
button .a${line} -text "${line} " -width 20 -command {
puts $line
}
pack .a${line}
} (0 Replies)
Discussion started by: hpuxrox
0 Replies
2. Shell Programming and Scripting
Can someone identify what is the problem here?.
no children
while executing
"exp_wait -nowait -i -1"
(procedure "logOptions" line 45)
invoked from within
"logOptions"
(procedure "doExecute" line 98)
invoked from within
"doExecute"
(procedure "main" line 32)
... (7 Replies)
Discussion started by: calsum
7 Replies
3. Shell Programming and Scripting
Does any one know how to capture the output of command called from a TCL script?
I cannot figure this out. I've been working on it for 4 hours now :confused: (2 Replies)
Discussion started by: Lorna
2 Replies
4. Shell Programming and Scripting
Hello,
Can someone explaine me the meaning of this program:
#! /usr/bin/tclsh
set mctal
set a
set b
set c
set d
set e
while {! line cell]} {
}
while {! line]} {
}
while {! line cell]} {
}
while {! line]} {
} (0 Replies)
Discussion started by: jolecanard
0 Replies
5. Shell Programming and Scripting
Hello,
I'm trying to make Tcl work with GNU readline. Tried searching the forum but difficult to find this specific thing with "read" search query. Could someone help me to understand the following behavior?
$ read -e
asdfasdfasdfasddddf
$ tclsh
% exec read -e
/usr/bin/read: read: bad... (0 Replies)
Discussion started by: pn8830
0 Replies
6. Shell Programming and Scripting
Hi all,
I wrote a TCL script in NS2 which involves running multiple Voice and video sessions. Am not able to troubleshoot one error at all. Can anyone please help me please. I am ready to send the documents if possible. please please help me guys !! I am trying to solve the problem since... (0 Replies)
Discussion started by: mehera
0 Replies
7. UNIX for Advanced & Expert Users
i am new one to tcl/tk
OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh
tclsh tclsh8.4
OTP-ARB:/home/ponmuthu/tcl=>/usr/bin/tclsh
% wish
Application initialization failed: no display name and no $DISPLAY environment variable
when i give like that i am getting error Application... (0 Replies)
Discussion started by: ponmuthu
0 Replies
8. Shell Programming and Scripting
how can i make a list with the n last files and their details in tcl?..
thanks. (0 Replies)
Discussion started by: eee
0 Replies
9. Programming
Dear Users
I'm struck by while the following tcl script.
foreach l {
set w($l) {}
set fsum 0
foreach ftemp $f($l) {
set fsum
lappend w($l) $fsum
}
}
It shows me error as "missing operand at _@_
in expression "0.10308400000000001 + _@_* 0.4 * 1"
... (0 Replies)
Discussion started by: bala06
0 Replies
10. Shell Programming and Scripting
I need to read a file, the file has a table in it. From the table I need to choose all the rows for which AVG 2 value is greater than 0.050 and write them on to a separate file. Please help me with the TCL script for this.
Thanks in Advance (0 Replies)
Discussion started by: tonystark
0 Replies
LEARN ABOUT REDHAT
itclvars
itclvars(n) [incr Tcl] itclvars(n)
NAME
itclvars - variables used by [incr Tcl]
DESCRIPTION
The following global variables are created and managed automatically by the [incr Tcl] library. Except where noted below, these variables
should normally be treated as read-only by application-specific code and by users.
itcl::library
When an interpreter is created, [incr Tcl] initializes this variable to hold the name of a directory containing the system library
of [incr Tcl] scripts. The initial value of itcl::library is set from the ITCL_LIBRARY environment variable if it exists, or from a
compiled-in value otherwise.
itcl::patchLevel
When an interpreter is created, [incr Tcl] initializes this variable to hold the current patch level for [incr Tcl]. For example,
the value "2.0p1" indicates [incr Tcl] version 2.0 with the first set of patches applied.
itcl::purist
When an interpreter is created containing Tcl/Tk and the [incr Tcl] namespace facility, this variable controls a "backward-compati-
bility" mode for widget access.
In vanilla Tcl/Tk, there is a single pool of commands, so the access command for a widget is the same as the window name. When a
widget is created within a namespace, however, its access command is installed in that namespace, and should be accessed outside of
the namespace using a qualified name. For example, namespace foo {
namespace bar {
button .b -text "Testing"
} } foo::bar::.b configure -background red pack .b Note that the window name ".b" is still used in conjunction with commands
like pack and destroy. However, the access command for the widget (i.e., name that appears as the first argument on a command line)
must be more specific.
The "winfo command" command can be used to query the fully-qualified access command for any widget, so one can write: [winfo command
.b] configure -background red and this is good practice when writing library procedures. Also, in conjunction with the bind com-
mand, the "%q" field can be used in place of "%W" as the access command: bind Button <Key-Return> {%q flash; %q invoke} While this
behavior makes sense from the standpoint of encapsulation, it causes problems with existing Tcl/Tk applications. Many existing
applications are written with bindings that use "%W". Many library procedures assume that the window name is the access command.
The itcl::purist variable controls a backward-compatibility mode. By default, this variable is "0", and the window name can be used
as an access command in any context. Whenever the unknown procedure stumbles across a widget name, it simply uses "winfo command"
to determine the appropriate command name. If this variable is set to "1", this backward-compatibility mode is disabled. This
gives better encapsulation, but using the window name as the access command may lead to "invalid command" errors.
itcl::version
When an interpreter is created, [incr Tcl] initializes this variable to hold the version number of the form x.y. Changes to x rep-
resent major changes with probable incompatibilities and changes to y represent small enhancements and bug fixes that retain back-
ward compatibility.
KEYWORDS
itcl, variables
itcl 3.0 itclvars(n)