Bernard Marcelly wrote:
Hi again, Jan,

Message de Jan Holst Jensen  date 2009-09-05 22:10 :

This behavior is not exactly clear from the Help description - here from the Help text about the "Dim Statement":

"Dim declares local variables within subroutines. Global variables are declared with the PUBLIC or the PRIVATE statement."

So we have global variables that do not hold data globally but only declare the variable globally. Strange notion... but of course useful when used in nested calls like I do in the dialog example code I listed.

Would be nice if the help described the lifecycle of variable content as well as the declaration scope.

Read the Basic Programming Guide, on the Wiki.
<http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Scope_of_Variables> The Basic Programming Guide is not up-to-date but is still valuable for learning the basics of Basic and API.

Regards
  Bernard

Much better information than the Help file - thanks. I added a note at the end of that Wiki page about the scope gotcha.

Cheers
-- Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to