I wish to have a script library, “libSite” that USEs another, nested, library “libError”.This allows me to just USE one library in Options.
Both libraries refer to constants defined in lsconst.lss and so this needs to be included in both.
When I save libSite, there is a compiler error as the definitions in lsconst.lss are included twice.
Can I conditionally include the file, depending on whether it has been included previously?
An equivalent of the C language
#ifndef XXX
#define XXX
#endif
would be ideal, but there seems to be no equivalent of #define in LS.
Regards
Harry
Subject: RE: Conditionally %include “lsconst.lss?”
You may have noticed that it’s possible to include the same script library twice from other script libraries without a problem. You might solve this issue by making a script library that just includes the LSS file, and then “Use” that script librayr from your other two.
I don’t like to add script libraries for no good reason, since it affects performance, but that should at least work. Or, perhaps someone else will have a better idea.
Subject: RE: Conditionally %include “lsconst.lss?”
Andre
Thanks for your suggestion and apologies for the delay in replying to it. For some reason I didn’t get notified about your post - I must have forgotten to tick the box…
I tried it out and it works fine. Many thanks for that.
Can you quantify the performance impact of using script libraries?
Is there a fixed cost due to the process of finding and loading the library regardless of size or a cost depending on how much is in the library?
Regards
Harry