1. go back to main program

I want something like a gosub in basic.havn't seen anything

new topic     » topic index » view message » categorize

2. Re: go back to main program

Alan sanderson wrote:
> 
> I want something like a gosub in basic.havn't seen anything

I think what you are looking for is a call to a procedure.  Just about all of
the demos have one or more procedures.

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

3. Re: go back to main program

Alan sanderson wrote:
> 
> I want something like a gosub in basic.havn't seen anything

Euphoria has procedures and fnctions.
Use the return statement to go back to main program from either:
* if routine is a procedure, then return works, and can be omitted ("end
procedure" causes a return to be executed).
* if routine is a function, return must be followed by a value/expression, which
becomes the result of the function call. There is no special variable to hold the
result of a function.

What you cannot do is targetting any place in your program and gosub-ing there.
You have to declare that chunk of code as a procedure. It is not in the main code
stream, so that you cannot enter it through the top; you can only call it,
perhaps indirectly.

CChris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu