学习tcl的几个好网络连接
2015-08-22 20:46
656 查看
1.http://archive.eso.org/skycat/docs/tclutil/tclutil.44.html
2.http://vzzllblog.bokee.com/4711864.html
3.http://tmml.sourceforge.net/doc/tcl/Tcl_Main.html
4.http://www.tcl.tk/man/tcl8.4/TclLib/Tcl_Main.htm
5.http://www.fundza.com/tcl/script_shell/arguments.html
---------------------------------------------------------------------------
2.http://vzzllblog.bokee.com/4711864.html
3.http://tmml.sourceforge.net/doc/tcl/Tcl_Main.html
4.http://www.tcl.tk/man/tcl8.4/TclLib/Tcl_Main.htm
5.http://www.fundza.com/tcl/script_shell/arguments.html
---------------------------------------------------------------------------
Tcl Command Line Arguments return to main index |
IntroductionAlthough Tcl scripts/procedures can be controlled via graphical user interfaces (GUI's) that have been implemented with the Tk toolkit, it is often easier to use traditional command line techniques. Another tutorial, using the command line, gave a simple example of invoking a Tcl script from the command line. This tutorial demonstrates how, at the time a script is invoked, data can be passed to the script from the command line. argumentsItems of data passed to a script from the command line are known as arguments. For example, take the simple script presented in using the command line tutorial. puts [expr 3 + 2]Lets assume the script has been saved as add.tcl and that the present working directory of the shell window in which we are working matches the directory in which the script has been saved. We know the script can be run using the following command, tclsh add.tclOf course the output is always the same because the values being added are hard-coded into the script. The script would be more useful if we could pass values to the script from the command line. tclsh add.tcl 23 15The method by which numbers can be passed into, and used by a script, is as follows. |
argc argv argv0All Tcl scripts have access to three predefined variables. $argc - number items of arguments passed to a script. $argv - list of the arguments. $argv0 - name of the script. To use the arguments, the script could be re-written as follows. if { $argc != 2 } { puts "The add.tcl script requires two numbers to be inputed." puts "For example, tclsh add.tcl 2 5". puts "Please try again." } else { puts [expr [lindex $argv 0] + [lindex $argv 1]] }The lindex command returns the first and second items from the list of arguments entered at the command line. Items in a list are counted from zero. |
相关文章推荐
- iOS开发——网络篇——JSON和XML,NSJSONSerialization ,NSXMLParser(XML解析器),NSXMLParserDelegate,MJExtension (字典转模型),GDataXML(三方框架解析XML)
- https实现的几个问题
- Python3.X 抓取网络资源
- hdu1532网络流
- virtualBox 上centos的网络配置 桥接方式(bridge)
- 为什么有了可靠地TCP还需要不可靠的UDP
- UNIX域套接字及TCP、UDP示例
- redis网络超时问题分析
- android 使用OkHttp上传多张图片
- socket编程--TCP客户/服务器模型 (c/s)及基本函数
- Util:Http请求的工具类
- HTTP状态详解
- 正则表达式——速查表(挖坑,本文内容来自网络)
- servlet生命周期详解
- 网络的五层协议体系---互联网协议入门
- TCP/IP-UDP
- CentOS网络配置
- R语言13行代码实现神经网络
- TCP UDP简介
- tinyhttpd解析