Re: global procedure / function
- Posted by xecronix Oct 05, 2015
- 1413 views
eeel said...
can anyone explain to me the difference between PROCEDURE and GLOBAL PROCEDURE? likewise between FUNCTION and GLOBAL FUNCTION?
That has to do with the scope of a declaration (Variable, Function or Procedure)
Euphoria 4.0 docs said...
- If the keyword global precedes the declaration, the scope of these identifiers extends to the whole application. They can be accessed by code anywhere in the application files.
- If the keyword public precedes the declaration, the scope extends to any file that explicitly includes the file in which the identifier is declared, or to any file that includes a file that in turn public includes the file containing the public declaration.
- If the keyword export precedes the declaration, the scope only extends to any file that directly includes the file in which the identifier is declared.
You can read more about this topic here.
- Official 4.0 documentation
- http://openeuphoria.org/wiki/view/Scope%20Export%20Example.wc
- http://openeuphoria.org/wiki/view/Three%20File%20Scope%20Example.wc
HTH