*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@50 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bcef419b66
commit
16ac3b10f8
16 changed files with 517 additions and 0 deletions
26
SWIG/Examples/tcl/simple/example.tcl
Normal file
26
SWIG/Examples/tcl/simple/example.tcl
Normal file
|
|
@ -0,0 +1,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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue