Re: Functions? I'm Lost!!
- Posted by Kat <gertie at PELL.NET> May 17, 2000
- 432 views
On 17 May 2000, at 17:20, David Roach wrote: Date sent: Wed, 17 May 2000 17:20:58 -0400 Send reply to: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> From: David Roach <roachd_76 at YAHOO.COM> Subject: Functions? I'm Lost!! To: EUPHORIA at LISTSERV.MUOHIO.EDU > Could someone give me an example of how to use a function. > I just can't seem to grasp the concept. I know they return > a value. I just can't find an example where anything for the > function is used any where else in the program. I'm just lost. >From the Eu help files: functions These are just like procedures, but they return a value, and can be used in an expression, e.g. function max(atom a, atom b) if a >= b then return a else return b end if end function Any Euphoria object can be returned. You can, in effect, have multiple return values, by returning a sequence of objects. e.g. return {x_pos, y_pos} We will use the general term "subroutine", or simply "routine" when a remark is applicable to both procedures and functions.