PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/ruby/simple/runme.rb

#
Ruby | 21 lines | 8 code | 7 blank | 6 comment | 0 complexity | 6cc9e94ba7059b47471b21e5ff071f15 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1# file: run.rb
 2
 3require 'example'
 4
 5# Call our gcd() function
 6
 7x = 42
 8y = 105
 9g = Example.gcd(x,y)
10printf "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
15print "Foo = ", Example.Foo, "\n"
16
17# Change its value
18Example.Foo = 3.1415926
19
20# See if the change took effect
21print "Foo = ", Example.Foo, "\n"