Re: Functions? I'm Lost!!
- Posted by "Darth Maul, aka Matt" <Uglyfish87 at HOTMAIL.COM> May 27, 2000
- 461 views
The following code defines a function that returns the number 5 and uses it: integer a -- Define an integer named "a" function return5() -- Define the function "return5" return 5 -- Return 5 end function a=return5() -- Get return5() to return its value and assign it to "a" ? a -- Print the integer "a", just to test it out The following code defines a function that returns the absolute value of a number and uses it: function abs(atom number) -- Defines abs(). return sqrt( number * number ) -- Behold the magic formula! end function ? abs(-54) -- Should say 54