首页 > 其他 > 详细

Introduction to the Tcl command language

时间:2016-09-19 22:09:32      阅读:187      评论:0      收藏:0      [点我收藏+]

tcl是基于字符串的语言。它允许:

1.变量和变量替换

2.数学表达式的求值

3.基本的控制结构(if,while,for,foreach)

4.程序

5.文件操作

incr a等价于a = a+1

每一句的结束可以换行,也可以用分号;

tcl基本的语法格式:

command $arg1 $arg2  ...

command是tcl的命令名称,也可以是用户定义的程序名称

$arg1 $arg2 为命令参数

支持命令的嵌套[] command [nested-command1] [nested-command2]

赋值语句 set a 1

注释用#: set a 5; #assign the value 5 to variable a

$符号表示提取数值,如puts $a

set a 1

set b a

set b $a

expr后加表达式会计算,如

>expr 2+3

5

 

Introduction to the Tcl command language

原文:http://www.cnblogs.com/jiangkejie/p/5886641.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!