1. scope example
- Posted by _tom (admin) Jul 18, 2013
- 1649 views
Testing how to include graphics in documentation.
TOM
Simple Example
In this example there are two files. The main file is myprog.ex and the module file is inc.e ; from the file extensions you can recognize that the .ex file will include the .e file.
The include statement works as if the module file is pasted into the primary file; the result is one big file to the interpreter. If this were completely true then few programs would run correctly. You can be sure that some identifiers from the module file will clash with identifiers already in use by the primary file. Since modules can include other modules you can imagine a program that becomes infinite in size.
The default is that when you include a module:
- a module is only included once (repeated include statements are ignored).
- statements in a module execute the first time they are encountered.
- all declarations are invisible (no identifiers from the module can be used by the primary file).
The examples are color coded to show:
- black...ordinary statements.
- blue...statements execute when included.
- gray...statements are invisible when included.
- comments in red.
Use the export keyword to make a declaration visible to the primary including file.http://i.imgur.com/YeolvWr.png
2. Re: scope example
- Posted by Kirkkaf13 Jul 18, 2013
- 1586 views
Hi Tom,
I have not read about scopes in Euphoria yet but this is nice and clear.
Kirk