import source from 1.3.40
[external/swig.git] / Examples / ruby / simple / runme.rb
1 # file: runme.rb
2
3 require 'example'
4
5 # Call our gcd() function
6
7 x = 42
8 y = 105
9 g = Example.gcd(x,y)
10 printf "The gcd of %d and %d is %d\n",x,y,g
11
12 # Manipulate the Foo global variable
13
14 # Output its current value
15 print "Foo = ", Example.Foo, "\n"
16
17 # Change its value
18 Example.Foo = 3.1415926
19
20 # See if the change took effect
21 print "Foo = ", Example.Foo, "\n"