Before CSPro can execute your program, it needs to check for errors in the logic. Errors include such problems as misspelling a command, not using proper command syntax, and putting logic in the wrong place. Warnings can also appear during compilation, and often occur from the use of
deprecated features.
You can choose to compile logic for a specific entity (such as a field, roster, or form) or for the entire application. To compile code for a specific entity, simply select that element from the
form or
batch edit tree. The associated logic for that item will be displayed in the
logic view. If you are ready to compile the entire application, select the root node (the topmost entry of the
data entry or
batch edit tree) and compile.
Press
on the toolbar; or from the
File menu, select
Compile; or press
Ctrl+K.
Error and warning messages will appear within the
Compiler Output tab of the
message view at the bottom of the
workspace. A dot will appear to the left of the line of code containing the problem—red dots indicate an error, yellow dots indicate a warning. Double-clicking the error or warning message will move your cursor to the offending line within the logic view.
To facilitate code development, you should compile your logic on a regular basis to ensure not too many errors are introduced. Depending on the number and type of errors, it can cause CSPro to have difficulty determining the source of the error (for example, missing "end" or "endif" statements can cause a lot of problems). If there are unfinished code blocks that won't compile, they should be commented out until ready to complete.
If there are no errors or warnings, the system will display "Compile Successful" within the Compiler Output tab. You are ready to run your application.If there are no errors but some warnings, the system will present a message for each problem found within the Compiler Output tab. You can run your application, but should make note of the problems found and attempt to resolve them.If one or more errors are found, you will not be able to run your program until they are resolved.