File: example.tcl

package info (click to toggle)
swig 1.1p5-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 9,448 kB
  • ctags: 5,025
  • sloc: cpp: 21,599; ansic: 13,333; yacc: 3,297; python: 2,794; makefile: 2,197; perl: 1,984; tcl: 1,583; sh: 736; lisp: 201; objc: 143
file content (26 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# Tcl script for testing simple example

# Try to load as a dynamic module.  If not, we'll just assume
# that it was statically linked in.

catch { load ./example.so example}
catch { load ./example.dll example}    ;# Windows

puts [get_time]
set tcl_precision 17
puts "My Variable = $My_variable"
for {set i 0} {$i < 14} {incr i 1} {
    set n [fact $i];
    puts "$i factorial is $n"
}

for {set i 1} {$i < 250} {incr i 1} {
    for {set j 1} {$j < 250} {incr j 1} {
	set n [mod $i $j]
	set My_variable [expr {$My_variable + $n}]
    }
}

puts "My_variable = $My_variable"