1. Begin...End; Begin...End.

Hi,again.
You know, I think I'm gonna begin my programming lessons on Euphoria.
I have only little problems,like how begins the main block of the program on
this language (like begin end. and TP)? How begin the block of a function or
a procedure?

Thank you very much.
Izchak Aronov.

new topic     » topic index » view message » categorize

2. Re: Begin...End; Begin...End.

On Thu, 16 Jan 1997, Izchak Aronov wrote:

>
> Hi,again.
> You know, I think I'm gonna begin my programming lessons on Euphoria.
> I have only little problems,like how begins the main block of the program on
> this language (like begin end. and TP)? How begin the block of a function or
> a procedure?
>
> Thank you very much.
> Izchak Aronov.
>
Functions are like this:

function apples(atom a, atom b, sequence blah)
:
:
: do whatever functions do
return (result1,result2...)
end function

Procedures are like this:

procedure update_screen()
:
:
: do whatever your procedure does
:
end procedure

pretty much anything that isn't inside the function..end function and
procedure..end procedure (or type..end type) is program and is executed in
the order it is in the source code beginning to end.

You can stick program code around your functions and procedures if you
want to. Its pretty sloppy, but you can do it if you want to.

Michael Packard
Lord Generic Productions
lgp at exo.com http://exo.com/~lgp
A Crash Course in Game Design and Production
http://exo.com/~lgp/euphoria

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

3. Re: Begin...End; Begin...End.

> You know, I think I'm gonna begin my programming lessons on Euphoria.
> I have only little problems,like how begins the main block of the program on
> this language (like begin end. and TP)? How begin the block of a function or
> a procedure?

the main program isn't defined as a block...  just put in code
anywhere except in procedures and functions and it'll execute it as
the main program...  procedures are defined as:

[global] procedure procedure_name([passed variables])
   .
   .
   .
end procedure

and functions are defined as:

[global] function function_name([passed variables])
  .
  .
  .
  return x
end function

hope that helps

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

Search



Quick Links

User menu

Not signed in.

Misc Menu