Michele Zarri wrote:
Hello,
I know that global variables are the devil, but I am not a programmer and I
really need to use a couple of those things. The OOo basic help file states
that a global variable is available for the [quote]current session[/quote].
I have created a small macro "subPrepareEnvironment" that runs when a
document is opened, reads a file and loads the values in the global
variables. The global variables are declared in the same module where the
sub is. I used a message box to make sure that the values are loaded
correctly.
Unfortunately, when I later call a macro (in the same library where the
above mentioned sub is) and try to use the global variable, the value is no
longer set.
I think the problem may be that I do not know what a current session is.
Could someone be so kind to explain it to me? Alternatively, am I making a
huge mistake and not realising it (quite possible)
Cheers,
Michele
Hi Michelle,
If you own my book, which I assume that you do not, check out page 44.
A global value will loose its value if the library in question is
recompiled. So, if you change anything in that library, then the Global
variables will lose their value. Also, if the library is unloaded or
reloaded.
Hope this helps.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]