Introduction to the Tcl command language

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

时间: 2024-08-02 06:55:41

Introduction to the Tcl command language的相关文章

Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file.

w https://linux.die.net/man/1/bash bash - GNU Bourne-Again SHell Description Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Kor

Tcl 简介及特性

[简介|特性] l  简介 Tcl是一门产生于80年代末的语言,和Python一样,她是用c开发出来的,如果说C/Java/C++/C#为编译型语言的话,那么Python.Perl和Tcl就是一门解释性语言,也就是说程序不需要先编译为机器能识别的二进制码,再运行程序,而是直接可以运行.其技术实现主要借助于Tcl中的库作为解析器.如果你知道Python的话,其执行过程如下:python先把代码编译成字节码,再对字节码解释执行 同为解释型语言,Tcl同样靠其内置分析器负责解释.编译型语言的优点是:因

SQL、PL/SQL、DDL、DML、TCL介绍

SQL:结构化查询语言(Structured Query Language) PL/SQL:过程化SQL语言(Procedural Language/SQL) DDL(Data Definition Language 数据定义语言) DML(Data Manipulation Language 数据操控语言) Tcl (最早称为"工具命令语言""Tool Command Language", 但是目前已经不是这个含义,不过我们仍然称呼它为TCL)是一种 脚本语言.

vivado中TCL的使用

Tcl介绍 Vivado是Xilinx最新的FPGA设计工具,支持7系列以后的FPGA及Zynq 7000的开发.与之前的ISE设计套件相比,Vivado可以说是全新设计的.无论从界面.设置.算法,还是从对使用者思路的要求,都是全新的.看在Vivado上,Tcl已经成为唯一支持的脚本 Tcl(读作tickle)诞生于80年代的加州大学伯克利分校,作为一种简单高效可移植性好的脚本语言,目前已经广泛应用在几乎所有的EDA工具中.Tcl 的最大特点就是其语法格式极其简单甚至可以说僵化,采用纯粹的 [命

使用Tcl脚本调用STC平台的Native API实现测试对象、Device、StreamBlock的创建和配置

环境配置如下: 在Windows的Conmand下操作 # # Configuration file(CommonConFig.tcl) # # Initializing the Script. # This script is used to set common configuration paramters used with the STC-300 class. #Step 1: Load Spirent TestCenter Automation API. # Type in the

PowerShell vs. PsExec for Remote Command Execution

Posted by Jianpeng Mo / January 20, 2014 Monitoring and maintaining large-scale, complex, highly distributed and interconnected systems can be extremely challenging for network administrators. Traditional IT management approaches are ill-equipped to

TCL数组

数组是一组使用索引对应元素的排列方式.常规数组的语法如下所示. set ArrayName(Index) value 用于创建简单数组的例子,如下所示. #!/usr/bin/tclsh set languages(0) Tcl set languages(1) "C Language" puts $languages(0) puts $languages(1) 当上述代码被执行时,它会产生以下结果. Tcl C Language 数组大小 用于计算数组大小的语法,如下所示. [arr

Iterate Files by Tcltk

Iterate Files by Tcltk [email protected] Abstract. Tcl/Tk provide a programming system for developing and using graphical user interface(GUI) applications. Tcl stands for “tool command language” and is pronounced “tickle”, is a simple scripting langu

C++开源库集合

| Main | Site Index | Download | mimetic A free/GPL C++ MIME Library mimetic is a free/GPL Email library (MIME) written in C++ designed to be easy to use and integrate but yet fast and efficient. It is based on the C++ standard library and heavily us