1. Shrouding files...

Hello all!

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.

Will I have to forget about making the routine user configurable?  Would
it be more sensible to add keys which would change these parameters as
the routine is running or locate the lines in the shrouded file which the
user can change (after all it is only colour, sort configuration!)

Any ideas?
Matt

PS: Reply personally please, as I'm not actually on the mailing list yet!
--
u5ms at csc.liv.ac.uk                        http://www.csc.liv.ac.uk/~u5ms/

new topic     » topic index » view message » categorize

2. Re: Shrouding files...

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.

Regards,
   Rob Craig
   Rapid Deployment Software

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

Search



Quick Links

User menu

Not signed in.

Misc Menu