Compiler Directives (DPL Code)
If you do a lot of programming with DPL, you may find yourself working with many files or copying some parts from one program to another. DPL offers several advanced techniques for working with your program files that can simplify this activity.
One technique allows you to break your programs into multiple files, which is especially convenient if you have certain definitions (constants, for example, or a converted spreadsheet model) that are used repeatedly in your programs. Another technique allows you to include several variations in a single program file and choose at compile time which variant should be compiled.
All of these techniques involve the use of compiler directives, which are instructions for the compiler which you embed in a program file.
What is a Compiler Directive?
The DPL language is not procedural. This means that a DPL program simply describes a decision problem, but does not include instructions on how to solve the problem. In this way, DPL is more like a spreadsheet than C++ or Visual Basic, which are procedural.
However, although a DPL program does not contain instructions for solving a decision analysis problem, it can contain directions to the compiler that control the process by which the compiler reads a DPL program and prepares it for analysis by the DPL engine.
These instructions are called compiler directives. Every compiler directive begins with a # symbol in the first column of a line of a program file. There are compiler directives that:
- Include additional program files in a compiled program
- Leave parts of a program file out of the compiled version
- Control optimization and spreadsheet evaluation
Versions: DPL Professional, DPL Enterprise, DPL Portfolio