That's the workaround I'll probably go for. Overriding the exiting command is still better as users and existing scripts do need to be aware of that. By creating new command we'll have to update scripts and users and in response get complains that our implementation is not compatible with TCL .
Hello all,
Some commands names in TCL are composed from several words for example "info tclversion" "info script" and "info body" . I need to override one of these commands ( "info script" ) but to keep the rest of them alive.
Unfortunately, overriding the command "info script" either...
You are right it is a specific problem to our in house parser that comes on top of the standart TCL parser. In the original TCL "proc" command (vs our "func" derivative of it) their indeed no problem and the empty string/list is past into the proc as I would expected. Our "func" command parse...
Can anyone explain what happend to an empty string ( "" ) when passed as parameter into a function.
I'm trying to do the TCL equivalnt for the C code :
void foo(const string & str ) {
if (str == "") {
cout << "Eurika";
}
}
What I see is that in the Tcl function the empty...
Little bug :
The regexp would through away also have of the string if it contain chars you didn't think of Like the '_' in Bongs example .
Better solution would be to use the "string trim" command
set trim_name [string trim $name "1234567890"]
# I know this would surprise many but...
Better have
set pat {^((0|0[0-9])|1[0-2]):[0-5][0-9]$}
or
set pat {^((0|[01][0-9])|2[0-3]):[0-5][0-9]$}
This should cover all valid time (12 hours or 24 hours ).
Just pay attention to the bounds 0:mm 12:mm 24:mm . It's up to you to decide whitch of those is a valid hour on earth
Hello all,
I found a weired problem that some commands like "clock seconds" or "after" would hang on windows if excuted after "info hostname"
Is that a known TCL problem
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.