Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tcl/Tk 8.5 Programming Cookbook

You're reading from   Tcl/Tk 8.5 Programming Cookbook With over 100 recipes, this Cookbook is ideal for both beginners and advanced Tcl/Tk programmers. From the basics to creating applications, it‚Äôs full of indispensable tips and tricks to make the most of the language.

Arrow left icon
Product type Paperback
Published in Feb 2011
Publisher Packt
ISBN-13 9781849512985
Length 236 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (20) Chapters Close

Tcl/Tk 8.5 Programming Cookbook
Credits
About the Author
1. Acknowledgment
About the Reviewers
2. www.PacktPub.com
3. Preface
1. The Tcl Shell FREE CHAPTER 2. Using the Building Blocks Control Constructs 3. Error Handling 4. Handling String Expressions 5. Expanding String Functionality Using Lists 6. The Tcl Dictionary 7. File Operations 8. Tk GUI Programming with Tcl/Tk 9. Configuring and Controlling Tk Widgets 10. Geometry Management 11. Using Tcl Built-in Dialog Windows 12. Creating and Managing Menus 13. Creating the Address Book Application

Chapter 6. The Tcl Dictionary

In this chapter, we will cover the following topics:

  • Creating a dictionary

  • Appending to a dictionary

  • Determining if a key exists

  • Filtering a dictionary

  • Searching a dictionary

  • Getting a record

  • Incrementing a value

  • Getting the dictionary structure

  • Getting a list of keys

  • Appending to an existing record

  • Merging two dictionaries

  • Create a blank dictionary structure

  • Updating variables from a dictionary

  • Determining the size of a dictionary

  • Getting all records

  • Assigning values

Introduction

Strings hold textual data from a single character to a large text file. Lists allow us to store groups of strings and lists in an organized manner. But neither offers a simple method for relating data elements to a key value, in the manner of an array or database. If you need to organize multiple items under a single group, nothing beats a dictionary.

Dictionary allows storage of data with a key/value mapping methodology, with each key in the dictionary mapping to a single value. Dictionaries are...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image