没有合适的资源?快使用搜索试试~ 我知道了~
Tcl and TK教程经典-Tcl and TK Toolkit-2
需积分: 10 14 下载量 159 浏览量
2010-12-14
08:38:00
上传
评论
收藏 706KB PDF 举报
温馨提示
试读
142页
Tcl/TK经典教程,关于TCL为数不多的教科书。对于使用EDA工具的开发人员用处非常大。
资源推荐
资源详情
资源评论
Tcl and the Tk Toolkit
John K. Ousterhout
Computer Science Division
Department of Electrical Engineering and Computer Sciences
University of California
Berkeley, CA 94720
Copyright © 1993 Addison-Wesley Publishing Company, Inc.
All rights reserved. Duplication of this draft is permitted by individuals for personal
use only. Any other form of duplication or reproduction requires prior written permis-
sion of the author or publisher. This statement must be easily visible on the first page
of any reproduced copies. The publisher does not offer warranties in regard to this
draft.
Note to readers:
This manuscript is a partial draft of a book to be published in early 1994 by Addison-
Wesley (ISBN 0-201-63337-X). Addison-Wesley has given me permission to make
drafts of the book available to the Tcl community to help meet the need for introduc-
tory documentation on Tcl and Tk until the book becomes available. Please observe
the restrictions set forth in the copyright notice above: you’re welcome to make a
copy for yourself or a friend but any sort of large-scale reproduction or reproduction
for profit requires advance permission from Addison-Wesley.
I would be happy to receive any comments you might have on this draft; send them to
me via electronic mail at ouster@cs.berkeley.edu. I’m particularly interested
in hearing about things that you found difficult to learn or that weren’t adequately
explained in this document, but I’m also interested in hearing about inaccuracies,
typos, or any other constructive criticism you might have.
2
DRAFT (8/12/93): Distribution Restricted
1
DRAFT (8/12/93): Distribution Restricted
Chapter 1 Introduction 1
1.1 Introduction 1
1.2 Organization of the book 3
1.3 Notation 4
Chapter 2 An Overview of Tcl and Tk 5
2.1 Getting started 5
2.2 Hello world with Tk 7
2.3 Script files 9
2.4 Variables and substitutions 10
2.5 Control structures 11
2.6 Event bindings 13
2.7 Subprocesses 15
2.8 Additional features of Tcl and Tk 18
2.9 Extensions and applications 18
2.9.1 Expect 19
2.9.2 Extended Tcl 19
2.9.3 XF 20
2.9.4 Distributed programming 20
2.9.5 Ak 22
Chapter 3 Tcl Language Syntax 25
3.1 Scripts, commands, and words 25
3.2 Evaluating a command 26
3.3 Variable substitution 28
3.4 Command substitution 29
3.5 Backslash substitution 30
3.6 Quoting with double-quotes 30
3.7 Quoting with braces 32
3.8 Comments 33
3.9 Normal and exceptional returns 33
3.10 More on substitutions 34
2
DRAFT (8/12/93): Distribution Restricted
Chapter 4 Variables 37
4.1 Simple variables and the set command 37
4.2 Arrays 38
4.3 Variable substitution 39
4.4 Removing variables: unset 40
4.5 Multi-dimensional arrays 41
4.6 The incr and append commands 41
4.7 Preview of other variable facilities 42
Chapter 5 Expressions 43
5.1 Numeric operands 43
5.2 Operators and precedence 44
5.2.1 Arithmetic operators 44
5.2.2 Relational operators 46
5.2.3 Logical operators 46
5.2.4 Bitwise operators 46
5.2.5 Choice operator 46
5.3 Math functions 47
5.4 Substitutions 47
5.5 String manipulation 49
5.6 Types and conversions 49
5.7 Precision 50
Chapter 6 Lists 51
6.1 Basic list structure and the lindex command 51
6.2 Creating lists: concat, list, and llength 53
6.3 Modifying lists: linsert, lreplace, lrange, and lappend 54
6.4 Searching lists: lsearch 56
6.5 Sorting lists: lsort 56
6.6 Converting between strings and lists: split and join 57
6.7 Lists and commands 58
3
DRAFT (8/12/93): Distribution Restricted
Chapter 7 Control Flow 61
7.1 The if command 61
7.2 Looping commands: while, for, and foreach 63
7.3 Loop control: break and continue 65
7.4 The switch command 65
7.5 Eval 67
7.6 Executing from files: source 68
Chapter 8 Procedures 69
8.1 Procedure basics: proc and return 69
8.2 Local and global variables 71
8.3 Defaults and variable numbers of arguments 72
8.4 Call by reference: upvar 73
8.5 Creating new control structures: uplevel 74
Chapter 9 Errors and Exceptions 77
9.1 What happens after an error? 77
9.2 Generating errors from Tcl scripts 79
9.3 Trapping errors with catch 80
9.4 Exceptions in general 81
Chapter 10 String Manipulation 85
10.1 Glob-style pattern matching 85
10.2 Pattern matching with regular expressions 88
10.3 Using regular expressions for substitutions 90
10.4 Generating strings with format 91
10.5 Parsing strings with scan 93
10.6 Extracting characters: string index and string range 94
10.7 Searching and comparison 94
10.8 Length, case conversion, and trimming 95
剩余141页未读,继续阅读
资源评论
jimaaa0
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功