|
||
User's Guide
|
|||||||||||||||||
Assume that SilverScreen has been installed in the \SILVER directory. Then the SilverScreen directory structure is as follows:
Because you may set the names of any of the above directories to whatever you like, we will refer to the directory type, not the actual name of the directory: that is, we will refer to “the executable directory”, rather than \SILVER\EX.
A complete description of the SilverScreen directory structure and how to modify the default settings appears in the SilverScreen Reference Manual. |
|||||||||||||||||
Compilation SilverC source programs have extension .C and are usually assumed to reside in the executable directory or the Silver directory, as specified in the current start-up environment. Header files (referenced via the #include preprocessor directive) may also reside in this directory, or in the home directory.
C programs are compiled with the COMPILE C command that appears in the TOOLS menu. The format of the command is:
COMPILE C <source program name>
At the prompt for source program name, the name can be entered manually or the Browse button may be used to display a popup of .C files for selection. At this point, compilation options may also be chosen; see the section on Configuring the Compiler. The source program name may be specified with or without the .C extension, and may include a path name. The result of the compilation is an executable file, with extension .EX. If the source file is specified without a path, the .EX file will be executable directory. If specified with a path, the .EX file will be created in that directory.
The following tables provide a summary of the rules governing directory search sequences and output directories for the SilverC compiler. The source filename is given by <name>, which may include a path; if it does, then that path is denoted by <path>. If multiple search directories are given, then they are searched in order from left to right. Note that SilverC does not distinguish between the two forms of the #include directive: the "filename" version and the <filename> version. For simplicity, we only refer here to the "filename" version.
For the command: COMPILE C <name>, the following applies:
For the preprocessor directive: #include "<name>", the following applies:
|
|||||||||||||||||
Errors In the case where syntax errors occur during compilation, the compilation will fail and no executable file will be generated. The number of errors encountered before the compiler gives up is given by a compiler option; the default is 100. See Configuring the Compiler. The SilverScreen text editor may be used to automatically trap compilation errors through a setting in the start-up environment. If this option is enabled, then the compiler, if compilation errors are encountered, loads the file into the text editor, and moves to the line where the first error was encountered. On exiting the editor, the user may restart the compilation by responding "y" to the question "Restart Compilation?". If this option is disabled, the compiler lists error messages on the screen, as if by using the predefined view_file function.
A file containing the error listings is generated by the compiler. If you wish to use another editor to maintain your source code, you may also wish to use the error file. By default, the error file is deleted automatically by the compiler; you may retain it by using a compiler option. See Configuring the Compiler.
|
|||||||||||||||||
Execution A program may be executed by selecting the EXECUTE command in the TOOLS menu (or by pressing F8) and entering the program name.
Programs can be executed from script files by using the script command:
EXECUTE <program name>
At the conclusion of program execution, control will return to the next line of script file. At a given time, only one program can be executing. Thus a program cannot in any way execute another program. Chaining is permitted, however, by using the chain or chain_and_return functions.
|