Re: Functions? I'm Lost!!

new topic     » goto parent     » topic index » view thread      » older message » newer message

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu