zoukankan      html  css  js  c++  java
  • tcltk 2

    Tcl supports the following mathematical functions in expressions:

    abs         acos        asin        atan
    atan2       bool        ceil        cos
    cosh        double      entier      exp
    floor       fmod        hypot       int
    isqrt       log         log10       max
    min         pow         rand        round
    sin         sinh        sqrt        srand
    tan         tanh        wide


        * switch string { pattern1 body1 ?pattern2 body2?...?patternN bodyN? }
        * while test body
        * for start test next body
    for {set i 0} {$i < 10} {incr i} {
        puts "I inside first loop: $i"
    }

        * proc name args body
    proc example {required {default1 a} {default2 b} args} {...}


    list ?arg1? ?arg2? ... ?argN?
        makes a list of the arguments
    split string ?splitChars?
        Splits the string into a list of items wherever the splitChars occur in the code. SplitChars defaults to being whitespace. Note that if there are two or more splitChars then each one will be used individually to split the string. In other words: split  "1234567" "36" would return the following list: {12 45 7}.
    lindex list index
        Returns the index'th item from the list. Note: lists start from 0, not 1, so the first item is at index 0, the second item is at index 1, and so on.
    llength list
        Returns the number of elements in a list.

    lsearch list pattern
        Searches list for an entry that matches pattern, and returns the index for the first match, or a -1 if there is no match. By default, lsearch uses "glob" patterns for matching. See the section on globbing.
    lsort list
        Sorts list and returns a new list in the sorted order. By default, it sorts the list into alphabetic order. Note that this command returns the sorted list as a result, instead of sorting the list in place. If you have a list in a variable, the way to sort it is like so: set lst [lsort $lst]
    lrange list first last
        Returns a list composed of the first through last entries in the list. If first is less than or equal to 0, it is treated as the first list element. If last is end or a value greater than the number of elements in the list, it is treated as the end. If first is greater than last then an empty list is returned.

  • 相关阅读:
    js直接获取当前windows登陆账号---仅适用于IE
    Windows变量路径与通配符
    IDEA数据库生成Entity 带注释, 默认值
    BIM+区块链在建筑业施工过程结算的应用
    Java中动态规则的实现方式
    Git查看本地仓库关联关系以及清理无效远程分支
    Golang把字符串数组、[]interface{}打乱、切片乱序
    Golang将map数组按照指定字段排序
    Golang把时间和数字相乘报错invalid operation: second * time.Second (mismatched types int and time.Duration)
    Golang获取明日时间及距离明日凌晨的时间差
  • 原文地址:https://www.cnblogs.com/greencolor/p/1896687.html
Copyright © 2011-2022 走看看