summaryrefslogtreecommitdiff
path: root/Examples/tcl/contract/runme.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/tcl/contract/runme.tcl')
-rw-r--r--Examples/tcl/contract/runme.tcl22
1 files changed, 22 insertions, 0 deletions
diff --git a/Examples/tcl/contract/runme.tcl b/Examples/tcl/contract/runme.tcl
new file mode 100644
index 0000000..3a6ce10
--- /dev/null
+++ b/Examples/tcl/contract/runme.tcl
@@ -0,0 +1,22 @@
+# file: runme.tcl
+# Try to load as a dynamic module.
+
+catch { load ./example[info sharedlibextension] example}
+
+# Call our gcd() function
+set x 42
+set y 105
+set g [gcd $x $y]
+puts "The gcd of $x and $y is $g"
+
+# Manipulate the Foo global variable
+
+# Output its current value
+puts "Foo = $Foo"
+
+# Change its value
+set Foo 3.1415926
+
+# See if the change took effect
+puts "Foo = $Foo"
+