Re: Shrouding files...

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

On June 28, Matt Sephton wrote:
> I have been trying to shroud a file which I have written.  It is a .e
> which is to be included in a number of programs.  I want to keep the
> source to myself.
> However, the shroud seems to have completed properly, but when I execute
> a normal, unshrouded .ex file which calls the routine I get an error:
> Cd(Dd)  Dd not defined.  This could be that I am trying to use Global
> constants to let the user configure the routine from the calling .ex file
> which are obviously called something totally different in the shrouded .e
> file.

What you are trying to do is a bit unusual, but quite reasonable. You can
do it, but there's a trick to it.

You should:
     1. declare the global constants in your matt.e file. e.g.
        global constant MAX = 10, MIN = 5
     2. shroud matt.e to get matt2.e (say)
     3. edit matt2.e to remove the line(s) that declare your global constants
        It will be easy to see because these global names won't be shrouded.
        You can also remove the first line, that has (without) warning
     4. Your users should declare:
        global constant MAX = 999, MIN = 777
        include matt2.e
        ... etc...
Your code will then access the values of these constants as defined by
your users.

In your .e file, remember to put "global" in front of the
declaration of any variables or routines that you want
your users to call.

   Rob Craig
   Rapid Deployment Software

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


Quick Links

User menu

Not signed in.

Misc Menu