Normally, is such cases, I tend to simply work around the problem and not spend too much time to the root cause. But, best practice is to investigate why the problem occurs, of course. Depends on the priority and importance of one's code I guess...
Anyway, one most simple workaround would be...
hi,
As Bong already pointed out, you need to create a procedure to search for file using 'glob'. See following Link
Furthermore, let's assume you have finally created your search procedure or somebody else on this forum has much more free time then me and can give you the script to results the...
Hi,
Not sure if it helps in your quest and/or if there are more simpler/logical solutions, but one might simply add toplevel bindings to the same key combinations of the menu entries, as soon as the user hides the menu. For example:
Lets suppose you have created a menu into the main toplevel...
Hi,
Had some spare time, been a while visiting this forum, here my 2 cents for what it's worth:
Additional script to main part:
set ::sel ""
$run config -command {puts "selected: $sel"}
proc add2List {selected add} {if {$add} {set ::sel "$::sel$selected "} {set ::sel [regsub -all $selected...
Hi,
Rather than examining your script, I opted for a custom solution. I hope it's what you are looking for:
set i 0
set start 0
foreach line [split $xml \n] {
if {[string first "col name=\"OPIS\"" $line]>0} {incr start}
if {([string trim $line]=="<linia>") && $start} {incr start}
if...
Hi,
I think you were close to the solution, I think what you need to do is:
replace
get_mroute_active [array get multicast]
with
get_mroute_active multicast
thacoda
Hi,
Not 100% sure if this is what u want, but here my shot:
set me [string range $me 0 [string last " " $me]]
Mind though, this method does assume a certain condition to the content of variable $me: the original $me content needs to have a space character before the actual number/string you...
Hi,
I am successful in the following case (created 2 dummy files with the same filenames you used as well as put these in a folder called 'rotz' in C-drive):
exec cmd.exe /c copy /A c:\\rotz\\prefix.txt+c:\\rotz\\ovb_grid.dtm c:\\rotz\\ovb_grid_temp.dtm
so, basically, 3 differences:
1. used...
Hi,
Is there a particular reason why you want to use tcl/tk for solving this problem? You say you want a workaround only. In that case, I would propose to use "sed", to manipulate (large) files. See Link. There is a version available of this ancient utility for most OS, if I correctly remember...
Glad it worked out for you!
The user manual of the BWidget Notebook, explains:
-image
Specifies an image to display for the page at the left of the label
If I understood your second question correctly, I believe you would like to add an additional image on the right side, which is the...
It took me a while, but with the help of the IDE that tG² provides and the easy access to the BWidget package, I could explore this Notebook widget and its script. It seems that a BWidget notebook is made up of a canvas. Thus bindings to canvas objects is what we need to create in order to...
set L0 {a b c}; set L1 {d e f}; set L2 {g h};
foreach n0 $L0 {foreach n1 $L1 {foreach n2 $L2 {puts "$n0 $n1 $n2 "}}}
this is just one way of doing it, a more dynamic method is possible but that requires more complexity.
David,
Regarding your questions how it works, I propose that you examine the following pages first:
http://www.tcl.tk/man/tcl8.4/TclCmd/
These are the basic tcl commands, this user manual is crucial while you learn tcl/tk. Also, check out "switch", it answers your search for a case statement...
Ok, then I would suggest the following way of working:
# from tG²
proc openFile {file} {
set f [open $file]
set content [read $f]
close $f
return $content
}
proc extractString {data} {
set i [string first "root" $data [string first "fake boot" $data]]
return [string range $data...
hi, this is how I would do it, since I am not so so with regular expressions:
set data "
bla1
root hahah, this one will be skipped grmem, so you know
bla3
bla fake boot hahaha
bla4
root hahha, place here a joke grmem and some more ...
bla5
root hahah, this one will be skipped grmem, so you...
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.