In Tcl commands, parameters are separated by spaces, just like Tcl lists are. So it would sometimes be very useful to be able to write
set action {piemiddle apple}
set $action
to take a list of parameters from a Tcl list - in this case setting the "piemiddle" variable to th ....
In Tcl, almost all variables are what is described as "pure" - which means that they hold data as strings of text which can be passed, substituted with a $ prefix, etc. Special interpretation on pure variables allows them to be treated as:
• integers
• floats
• lists
• dicts
&bul ....
Have you seen Perl method calls that look like this?
$present = new box(-smell => "chocolate", noise => "silent");
and wondered "what is all this => stuff" and "what's the - sign for"?
That's a call that could be fairly typical of the sort you'll see in the documentation of any number o ....
This TUESDAY evening ... are YOU available?
Melksham Town Hall on Tuesday January 17th at 6.30pm, with refreshments from 6pm. The meeting is free and informal, and open to anyone who would like to contribute or simply listen. If you need a lift home after the meeting, let me know - I'm aware that t ....
A week in Cambridge - traveling there, and around when I needed, without a car - and a chance to look, listen and learn a bit more about the wider transport issues of that city. Some may be lessons for us in Wiltshire, others may be items that I simply say "won't work here because of ...".
Between ....
It's been a busy start to the training and hotel year 2012 at Well House. I've already taught Learning to Program in Tcl, Tcl and Expect Programming, and two tailored private courses - Perl Programming and a more advance Perl course based on Perl for Larger Projects. Room occupancy at Well House M ....
In Perl, you can have a list of lists, a hash of hashes, a hash of lists or a list of hashes - in effect, two dimensional arrays but with much more flexibility.And where you can have two dimensional arrays, you can go further and have 3, 4, or more dimensions - you are limited only by your ingenuity ....
Question:
Why does this code:
set dir "D:/JNN/proc/"
set tempname "D:/JNN/proc/Doc-99887767.dat"
set cname [string trimleft $tempname $dir]
puts $cname
report
-99887767.dat
but this code:
set dir "D:/JNN/proc/"
s ....
Question:
1. I have created a table dynamically using a for loop in Tcl/Tk.
2. One of the columns in the table is a column of buttons
3. All the buttons call the same action proc as the each do something similar
How can I set up the buttons so that I know which was pressed in the action proc?
Ans ....
Typically, functions / named blocks of code take a series of operands / parameters as inputs, and return a result which is saved into another variable - here's an example in Perl:
$size = length($persname);
Incoming value - read from $persname
Action defined in - length
Outgoing value ....