1. Constant Functions

------=_NextPart_000_0005_01C00D35.AAE5F980
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Can someone explain to me the concepts of a function and a constant?

thenk yew,

------Thomas



------=_NextPart_000_0005_01C00D35.AAE5F980
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Can someone explain to me the concepts =
of a=20
function and a constant?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thenk yew,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>------Thomas</FONT></DIV>
<DIV>&nbsp;</DIV>

------=_NextPart_000_0005_01C00D35.AAE5F980--

new topic     » topic index » view message » categorize

2. Re: Constant Functions

A constant is a variable whose value cannot be changed once it is set.

A function is a procedure that returns a value - like in math, sin(x)
returns a value.

===== Original Message from Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU> at 8/23/00 10:09 pm
>Can someone explain to me the concepts of a function and a constant?
>
>thenk yew,
>
>------Thomas

new topic     » goto parent     » topic index » view message » categorize

3. Re: Constant Functions

------=_NextPart_000_000B_01C00D55.FD0AD260
        boundary="----=_NextPart_001_000C_01C00D55.FD0AD260"


------=_NextPart_001_000C_01C00D55.FD0AD260
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The only constant in life, is death.....
("from StarTrek Generations")=20

Seriously, A constant is something that never changes,
it always remains the same....thereby the meaning
CONSTANT.

A Function is usefull when trying to figure something out.
* return a (value or text) from the user, calculate etc.
you need to feed in info massage that info and
return something of use.=20

In the attached file you'll find lots of thing

constants
functions
procedures
file I/O
user I/O
setting up graphics modes
palette utility
display of various boxes

it's pretty loaded but isn't very functional
I'll leave that up to you....

  ----- Original Message -----=20
  From: Paul Kerslake=20
  To: EUPHORIA at LISTSERV.MUOHIO.EDU=20
  Sent: Wednesday, August 23, 2000 10:09 PM
  Subject: Constant Functions


  Can someone explain to me the concepts of a function and a constant?

  thenk yew,

  ------Thomas



------=_NextPart_001_000C_01C00D55.FD0AD260
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>The only constant in life, is=20
death.....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>("from StarTrek Generations") =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Seriously, A constant is something that =
never=20
changes,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>it always remains the same....thereby =
the=20
meaning</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CONSTANT.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A Function is usefull when trying to =
figure=20
something out.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>* return a (value =
or&nbsp;text)&nbsp;from the user,=20
calculate etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>you need to feed in info massage that =
info=20
and</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>return something of =
use.</FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In the attached file you'll find lots =
of=20
thing</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>constants</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>functions</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>procedures</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>file I/O</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>user I/O</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>setting up graphics modes</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>palette utility</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>display of various boxes</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>it's pretty loaded but isn't very=20
functional</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'll leave that up to =
you....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dpaulk at UNISERVE.COM href=3D"mailto:paulk at UNISERVE.COM">Paul =
Kerslake</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3DEUPHORIA at LISTSERV.MUOHIO.EDU=20
  =
</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, August 23, =
2000 10:09=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Constant =
Functions</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Can someone explain to me the =
concepts of a=20
  function and a constant?</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>thenk yew,</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>------Thomas</FONT></DIV>
  <DIV>&nbsp;</DIV>

------=_NextPart_001_000C_01C00D55.FD0AD260--

------=_NextPart_000_000B_01C00D55.FD0AD260
        name="video.ex"
Content-Transfer-Encoding: quoted-printable

new topic     » goto parent     » topic index » view message » categorize

4. Re: Constant Functions

On Wed, 23 Aug 2000, John Coonrod wrote:
> A constant is a variable whose value cannot be changed once it is set.
>
> A function is a procedure that returns a value - like in math, sin(x)
> returns a value.

To elaborate just a bit:

A constant in most languages can contain a single value:
pi = 3.1415,
or
name = "Joe Blo"

however, in Euphoria, constants can be that, or any arbitrarily complex
object:
constant first_release = { "Irv Mullins", "irv at ellijay.com", 1.0, 12.99 }

where first_release[1] = my name
         first_release[2] = my e-mail
         first_release[3] = version # 1.0
         first_release[4] = price ($12.99)

These values are fixed. Any attempt to change them within the program
will cause an error.

Likewise, functions can accept, act upon, and return arbitrarily complex
objects:

function upgrade(object release)
release[3] += .1
release[4] += 2.00
return release
end function

obect newrelease

newrelease = upgrade(first_release)
After this call, everything in newrelease is the same as was in first_release,
except the version is now 1.1  and the price is 14.99

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: Constant Functions

>Can someone explain to me the concepts of a function and a constant?
>thenk yew,
>------Thomas

to further explain these concepts, beyond what was replied so far....
try this as an example:
-------------------------------------------
constant PI = 3.14159   --that is now a fixed value assigned to the word
'PI'

function ComputeCircleArea(atom radius)
atom area
   area = PI * radius * radius  --pi * R^2
   return area -- a function must return a value of some sort
                    -- be that a number or a sequence
end function
--------------------------------------------
hope this helps --Hawke'




____________NetZero Free Internet Access and Email_________
Download Now     http://www.netzero.net/download/index.html
Request a CDROM  1-800-333-3633
___________________________________________________________

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu