Tcl Tutorial 笔记4 ·if
目录
- if语法
- example
if语法
if {expr1} ?then? {body1} elseif {expr2} ?then? {body2} elseif {...} else {bodyN}
example
set x 1if {$x == 2} {puts "$x is 2"} else {puts "$x is not 2"}if {$x != 1} {puts "$x is != 1"
} else {puts "$x is 1"
}
Resulting output
1 is not 2
1 is 1
Tcl Tutorial 笔记4 ·if相关推荐
- Tcl Tutorial 笔记1 · 输出
目录 Simple Text Output tcl的注释 输出 puts 参考 Simple Text Output tcl的注释 命令行后进行注释使用 ;# puts "Hello, Wo ...
- Tcl Tutorial 笔记10 · list
在tcl 中列表是一个集合:列表里可以是数字,字符,字符串,或者是其他的列表. 创建列表的几种方法: 1.手动创建列表型变量 set lst {{item 1} {item 2} {item 3}} ...
- Tcl Tutorial 笔记 ·ubuntu命令行运行tcl 命令
ubuntu 安装tcl : sudo apt-get install tcl 在ubuntu命令行运行tcl 命令: usually via running "tclsh" or ...
- Tcl Tutorial 笔记9 · proc 参数传递与return
目录 proc的参数 example1 example2 proc的参数 可以proc传递固定数量的参数,也可以传递数量的可变的参数传递给proc,传递给proc的参数,可以设值默认值,如需要将传递的 ...
- Tcl Tutorial 笔记8 · proc
目录 proc Example Advanced usage proc 在tcl中,proc与在其他的编程语言中的函数是没有差别的. proc 命令创建一个新命令.proc命令的语法是: proc n ...
- Tcl Tutorial 笔记7 ·for incr
目录 for 与 incr for 语法 Example incr Example for 与 incr for 语法 for start test next body 在这里 start 是一个对变 ...
- Tcl Tutorial 笔记6 ·while
目录 while 语法 while 语法 while test {body} 在这里test 作为一个表达式,if test 条件成立将执行body中的内容,如果不成立将跳出该循环. 另外注意 tes ...
- Tcl Tutorial 笔记3 ·math
目录 expr Operators 数字上的操作 数学函数 Type conversions 数组 example Example 1 Example 2 未完待续... expr 用于进行数学计算的 ...
- Tcl Tutorial 笔记2 · set ““ {} [] \
目录 变量赋值 set Example 替换 Substitutions "" Backslashes \ Example2 替换 Substitutions {} Example ...
- Tcl Tutorial 笔记5 ·switch
目录 switch 语法规则 example 参考资料 switch 语法规则 switch ?options? string {pattern1 {body1}?pattern2 {body2}?. ...
最新文章
- iOS11、iPhone X、Xcode9 适配指南
- 在AFN中使用NSXMLParser解析服务器返回的XML数据
- 四十、SPSS数据汇总,图表制作,频率分析和描述分析
- Linux Ubuntu使用技巧
- Spring Boot学习笔记(1)
- 人工神经网络——笔记摘抄1
- 关于 vmware虚拟机的一些问题及解决办法备忘
- python os.forkos.wait
- 程序员遇到什么样的工作状态应该果断跳槽走人?
- java并发令牌机制,redis令牌机制实现秒杀
- java cookie id,我如何在Java中获取会话ID
- 【超参数寻优】交叉验证(Cross Validation)超参数寻优的python实现:多参数寻优
- XNA 如何使用字体绘制文字,Windows Phone 游戏开发
- swagger 接口参数顺序_Swagger常用参数用法
- svn删除远程文件和忽略文件
- 淘淘商城第105讲——购物车实现分析及工程搭建
- 如何优化Web服务器以实现高吞吐量和低延迟
- html5手机 一键开发,Html5变革下的H5和手机app开发工具
- Kubernetes K8S之资源控制器Job和CronJob详解
- 【考研英语语法】形容词练习题