Entry Point
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
Normally, program execution starts with the Main Method, but from Apr10 onwards an Entry Point may be provided.
This allows one source module in an .exe project to have a classic "Turbo Pascal/Delphi" style entry point block of code, with a "begin/end." pair, as shown below.
- This does not require any setting such as "allow globals" or the like.
- If more than one such code block is found, then, just as with multiple Main class methods, a compiler error will be raised.
- If such an entry point is defined AND any Main class method(s) are found, the entry point would take precedence over the Main class methods (which would then act as a regular class method).
In addition, interface/implementation will be optional, but only when there is a begin/end right after the namespace and/or uses.
namespace MyProject; begin Console.WriteLine('Hello There!'); end.
namespace MyProject; interface // ... implementation //... begin // Entry Point end.
Note: The begin/end block is unique by not being within a class member.
See Also
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To