Re: Calling Procedure in an .e file

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

Make the procedure global in your include file then simply call it thus:

include 33matrix.e
module_3()


> -----Original Message-----
> From: Euphoria Programming for MS-DOS
> [mailto:EUPHORIA at cwisserver1.mcs.muohio.edu]On Behalf Of Alan Tu
> Sent: Thursday, May 28, 1998 5:34 PM
> To: EUPHORIA at cwisserver1.mcs.muohio.edu
> Subject: Calling Procedure in an .e file
>
>
> I have a perfectly working program, and I want to turn it
> into an include
> file.  So I put procedure module_3() at the top, and end
> procedure at the
> bottom.  And I make sure that all the variable declarations
> in the include
> file are outside the procedure.  (One can't declare stuff in
> a procedure?)
> If this is so, how can I declare private variables.  And of course, I
> rename the file with an .e extention.
>
> Than I have the following test.ex program:
> The test program and the procedure include file are in the
> same directory,
> the current directory, but it is not \euphoria\include.
>
> -----test.ex-----
> include 33matrix.e
> procedure module_3()
> -----end test.ex-----
>
> Of course, for those expert Euphorians, you know this didn't work.
>
> But when I added end procedure to the .ex file, it executed
> fine, which
> means (I think) that it assumed that procedure module_3 was
> in the main .ex
> file.  OK, so what are include files good for?  I don't get
> it.  How can I
> call a procedure in an .e file?
>
> --Alan
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu