The compile options (BuildOptions object) exposes a number of settings that determine how the code for your document is internally compiled.
In most basic cases, you don't have to do anything else to execute code as you write it. Simply type in expressions or statements as required, build the documents or run the code and the program will evaluate and display the results.
In some cases, it will be necessary to change some settings. To do so, make sure the Properties Window is visible (View | Properties Window, or F4 key), and select Compile Options in the drop-down list. The Properties Window displays several pairs of settings and their values (Figure 1).
Figure 1. The Properties Window displaying document compile options.
Lists all namespaces imported (using directives, Imports directives). Some namespaces are already listed in the namespace selector, so you can check them in one click instead of full typing them every time.
Note: This property also applies to the UserCode property, but does NOT apply to referenced source files. Source files must include their own namespace import statements.
If true, makes debugging info (symbols and source code) available to use in a .NET debugger. Enable debugging info to spot errors in documents with large amount of code. The default is false.
Choose from the .NET languages installed on your machine. Languages installed with the .NET Framework are C#, VB.NET and JScript. Languages such as J# may be installed separately. The default language is C#.
The namespace in which to build the code.
Figure 2. Reference selector (Referenced Assemblies).
Lists all files which contain source code used by the input. Useful to maintain some reusable source code without having to compile it in a library. The user interface for the source file selector is very similar to the assembly reference selector (Figure 2).
Contains any additional class declarations you need. To edit the user code, display the Code Pane by clicking the Code view button, or by activating View | Code in the menu, and look for the BuildOptions | UserCode in the Fragments tree.
Note: Code in the UserCode section should be ready to build as if it was a separate file, independently from any document code. Namespaces listed in the Imports property will apply to the user code section, but you must explicitly import the namespaces in the referenced source files.
Copyright © Q. Binh Dam 2004-2007. Last modified: 27 Aug. 2007.