1. Making Librarys "something.e"

Hi All

  Ive had Euphoria for a little over a week. Having
used QuickBasic for years and a very little 'C' , it didnt take long
to realy appreciate Euphoria. Yep its now registered to me too! :')

  My question is this: Can I just take some Procedures I am
using in a program and save them as a  'something.e' file then
call each Procedure as I do the ready made librarys? I'd like
to do this so I dont have to look at them all the time while Im
coding my program.
 Perhaps somebody could do a little tutor on all that needs to
go into a library.
  Guess I should just experiment. LOL (brave soul that I am.)

  Thank you
   Gene Mannel

new topic     » topic index » view message » categorize

2. Re: Making Librarys "something.e"

Greetings

Yes, you can create an include file to contain many procedures and functions
you made, or others made as well.

Chapter 28 of  "A Beginner's Guide To Euphoria" shows you how to create a
simple include file to store a procedure. I've copied the information from
the tutorial to show you here.

1) -------include file d2808a.e starts here -----------------
global sequence valid_capitals
valid_capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

global procedure show_trademark()
     puts(1,"**********************************************\n")
     puts(1,"*  Copyright 1997 Mom, The Cat Smells Funny! *\n")
     puts(1,"*                Productions                 *\n")
     puts(1,"*                                            *\n")
     puts(1,"*                 |\\\\\"\"\"//|                  *\n")
     puts(1,"*                 {_ O O _}                  *\n")
     puts(1,"*                   {/~\\}                    *\n")
     puts(1,"*                    \"\"\"                     *\n")
     puts(1,"**********************************************\n")
end procedure
-----------------------------------------------------

2) Program referencing include file starts
here -----------------------------------------------------
include d2808a.e
print(1,find('J',valid_capitals))
puts(1,"\n\n")
show_trademark()
----------------------------------------------------------------------------
--------------------------



















----- Original Message -----
From: "Gene Mannel" <genem2 at GJ.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Sunday, July 30, 2000 12:48 PM
Subject: Making Librarys "something.e"


> Hi All
>
>   Ive had Euphoria for a little over a week. Having
> used QuickBasic for years and a very little 'C' , it didnt take long
> to realy appreciate Euphoria. Yep its now registered to me too! :')
>
>   My question is this: Can I just take some Procedures I am
> using in a program and save them as a  'something.e' file then
> call each Procedure as I do the ready made librarys? I'd like
> to do this so I dont have to look at them all the time while Im
> coding my program.
>  Perhaps somebody could do a little tutor on all that needs to
> go into a library.
>   Guess I should just experiment. LOL (brave soul that I am.)
>
>   Thank you
>    Gene Mannel
>

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

3. Re: Making Librarys "something.e"

Hi again
  Thanks for the info David.

 Id like to thank you and all the others who have made
these help files so clear and useable.
  Im glad you are all so willing to help.
   Thanks
   gene

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

4. Re: Making Librarys "something.e"

Hi Gene
You've got the right idea for making libraries.
If you want to call a procedure from something.e from a program main.ex,
then the procedure or function if something.e must be declared as a global
procedure or function.

ie
something.e

procedure  foo()
    do something
end function

global procedure bar()
    foo
    something else
end procedure


main.ex
    bar

You can call bar from main, but not foo, which remains local to the library
and can only be used from within it

Bye
Martin Hunt

simulat at intergate.bc.ca


----- Original Message -----
From: Gene Mannel <genem2 at GJ.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Sunday, July 30, 2000 9:48 AM
Subject: Making Librarys "something.e"


> Hi All
>
>   Ive had Euphoria for a little over a week. Having
> used QuickBasic for years and a very little 'C' , it didnt take long
> to realy appreciate Euphoria. Yep its now registered to me too! :')
>
>   My question is this: Can I just take some Procedures I am
> using in a program and save them as a  'something.e' file then
> call each Procedure as I do the ready made librarys? I'd like
> to do this so I dont have to look at them all the time while Im
> coding my program.
>  Perhaps somebody could do a little tutor on all that needs to
> go into a library.
>   Guess I should just experiment. LOL (brave soul that I am.)
>
>   Thank you
>    Gene Mannel
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu