Here are the events discussed in this section:
Purpose:
Builds the current target or project.
Build
Performs the Make command in the Project Menu.
Purpose:
Checks the syntax of the specified file(s).
Checkfilename-list
This event is equivalent to performing the Check Syntax command in the Project Menu. Replace filename-list with a single filename or a list of filenames in the project.
By default, Check returns a list of short integer result codes for each file checked.
A result code can either be the value of an OSErr (Operating System
Error) or one of the following values:
A list of results of type short integer.
Listing 0.11 Examples for Check File Syntax
Check File Syntax "MyFile.c"
Check File Syntax {"MyFile.c", "YourFile.c"} with ExternalEditor
Purpose:
Checks the syntax of the specified file(s).
Check Syntax filename-list [with ExternalEditor]
This event is equivalent to performing the Check Syntax command in the Project Menu. Replace filename-list with a single filename or a list of filenames in the project.
By default, Check Syntax returns a list of short integer result codes for each file checked.
A result code can either be the value of an OSErr (Operating System
Error) or one of the following values:
If the ExternalEditor option is used, the environment returns the Message window contents
instead of the usual list of short integer results. The AppleEvent
keyword for ExternalEditor is 'Errs'. It takes a boolean parameter.
Returns:
A list of results of type short integer, or, if the ExternalEditor option is specified, a list of records of type 'ErrM'.
Listing 0.12 Examples for Check Syntax
Check Syntax "MyFile.c"
Check Syntax {"MyFile.c", "YourFile.c"} with ExternalEditor
Purpose:
Compiles the specified file(s).
Compile filename-list [with ExternalEditor]
This event is equivalent to performing the Compile command on the Project Menu. Replace filename-list with a single filename or a list of filenames.
By default, Compile returns a list of short integer result codes for each compiled
file. A result code can be an OSErr value (Operating System Error)
or one of the following:
If the ExternalEditor option is specified, the environment returns the Message window
contents as a list of 'ErrM' objects.
Returns:
A list of errors of type short integer or, if ExternalEditor is specified, of type 'ErrM'.
Listing 0.13 Examples for Compile
Compile "MyFile.c"
Compile {"MyFile.c", "YourFile.c"}
Purpose:
Compiles the specified file(s).
Compile File filename-list
This event is equivalent to performing the Compile command on the Project Menu. Replace filename-list with a single filename or a list of filenames.
By default, Compile returns a list of short integer result codes for each compiled
file. A result code can be an OSErr value (Operating System Error)
or one of the following:
A list of errors of type short integer.
Listing 0.14 Examples for Compile
Compile File "MyFile.c"
Compile File {"MyFile.c", "YourFile.c"}
Purpose:
Disassembles the specified file(s).
Disassemble File filename-list
This event is equivalent to performing the Disassemble command on the Project Menu. Replace filename-list with a single filename or a list of filenames.
Returns:
A list of errors of type short integer.
Listing 0.15 Examples for Disassemble File
Disassemble File "MyFile.c"
Disassemble File {"MyFile.c", "YourFile.c"}
Purpose:
Make Project [with ExternalEditor]
Performs the Make command in the Project Menu.
If the ExternalEditor option is used, the environment returns the Message window contents.
Returns:
By default, Make Project returns nothing. If ExternalEditor is specified, Make Project returns a list of errors of type 'ErrM'.
Purpose:
Precompiles the specified file.
Precompile source saving as destination [ with ExternalEditor ]
This event is equivalent to the Precompile command in the Project Menu. Replace source with the name of a file to precompile. Replace destination with the filename of the precompiled header.
If the ExternalEditor option is used, the environment returns the Message window contents.
Returns:
By default, Precompile returns nothing. If ExternalEditor is specified, Precompile returns a list of errors of type 'ErrM'.
Listing 0.16 Example for Precompile
Precompile "MyHeaders.pch" saving as "MyHeaders.mch"
Precompile "tip.pch" saving as "tip.mch" with ExternalEditor
Purpose:
Preprocesses the specified file.
Preprocess source [ with ExternalEditor ]
This event is equivalent to the Preprocess command in the Project Menu. Replace source with the name of a file to preprocess.
If the ExternalEditor option is used, the environment returns the Message window contents.
Returns:
By default, Preprocess returns nothing. If ExternalEditor is specified, Preprocess returns a list of errors of type 'ErrM'.
Listing 0.17 Examples for Preprocess
Preprocess "MyHeaders.c"
Preprocess "tip.c" with ExternalEditor
Purpose:
Removes the binary object code from the current project.
Remove Binaries
Performs the equivalent of the Remove Object Code command in the Project Menu.
Returns:
Purpose:
Removes the binary object code from the current target or project.
Remove Object Code
Performs the equivalent of the Remove Object Code command in the Project Menu.
Returns:
Purpose:
Runs the current project or target.
Run
Performs the equivalent of the Run command in the Project Menu. This event builds then executes the current target if there are no compile or link errors.
Returns:
By default, Run Project returns nothing.
Purpose:
Run Project[with ExternalEditor] [with SourceDebugger]
Performs the equivalent of the Run command in the Project Menu. This event builds then executes the current project if there are no compile or link errors.
If the ExternalEditor option is used, the environment returns the Message window contents.
If the SourceDebugger option is used, the environment launches the successfully-built
project into the source-level debugger.
Returns:
By default, Run Project returns nothing. If ExternalEditor is specified, Run Project returns a list of errors that occurred when running the project,
of type 'ErrM'.
Listing 0.18 Examples for Run Project
Run Project withSourceDebuggerRun Project withExternalEditor
Purpose:
Touches the specified file(s).
Touch filename
Performs the equivalent of clicking the Touch column in a Project window. Touching a file forces it to be recompiled during a make operation. Replace filename with a single file or a list of files to touch.
For more on touching a file to be recompiled, consult the IDE User Guide for information on synchronizing files.
Returns:
A list of errors. Each result code can have one of the following values:
Listing 0.19 Examples for Touch
Touch "MyFile.c"
Touch { "MyFile.c", "YourFile.c" }
Purpose:
Update Project [ with ExternalEditor ]
This command is equivalent to the Bring Up To Date command in the Project Menu. If the ExternalEditor option is used, the environment returns the Message window contents.
Returns:
By default, Update Project returns nothing. If ExternalEditor is specified, Update Project returns a list of errors of type
'ErrM'.