-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Tcl/Tk 8.5 Programming Cookbook
One way to create a list is to simply use the list command. Bear it in mind that with this command you must be aware of quotations. Inconsistent quotations can have unexpected results on the list elements. The syntax is as follows:
list value1 value2…
In the following example, we will create a list containing single characters. Return values from the commands are provided for clarity. Enter the following command:
% list John Mary Bill John Mary Bill
The list commands returns a list containing all the arguments supplied, or an empty string if no arguments are specified. Backslashes and braces are added to the string representation of the list as it is necessary to provide a properly formatted list that will work with any list command.
As mentioned earlier, quotation marks can alter how items are stored in our list. In the following example, we will recreate our list; but this time the elements will be encased in quotation marks to illustrate...
Change the font size
Change margin width
Change background colour