PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/tcl/value/runme.tcl

#
TCL | 39 lines | 26 code | 8 blank | 5 comment | 0 complexity | 115af3befa826ab1c71228895d22e389 MD5 | raw file
 1# file: runme.tcl
 2# Try to load as a dynamic module.
 3
 4catch { load ./example[info sharedlibextension] example}
 5
 6# Create a couple of a vectors
 7
 8set v [new_Vector 1 2 3]
 9set w [new_Vector 10 11 12]
10
11puts "I just created the following vectors"
12vector_print $v
13vector_print $w
14
15# Now call some of our functions
16
17puts "\nNow I'm going to compute the dot product"
18set d [dot_product $v $w]
19puts "dot product = $d (should be 68)"
20
21# Add the vectors together
22
23puts "\nNow I'm going to add the vectors together"
24set r [vector_add $v $w]
25vector_print $r
26puts "The value should be (11,13,15)"
27
28# Now I'd better clean up the return result r
29
30puts "\nNow I'm going to clean up the return result"
31free $r
32
33puts "Good"
34
35
36
37
38
39