[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Building Events

Here are the events discussed in this section:


Build

Purpose:

Builds the current target or project.


Build

Description:

Performs the Make command in the Project Menu.

Returns:

By default, Build returns nothing.


Check

Purpose:

Checks the syntax of the specified file(s).


Checkfilename-list

Description:

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


Check Syntax

Purpose:

Checks the syntax of the specified file(s).


Check Syntax filename-list [with ExternalEditor]

Description:

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


Compile

Purpose:

Compiles the specified file(s).


Compile filename-list [with ExternalEditor]

Description:

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"}


Compile File

Purpose:

Compiles the specified file(s).


Compile File filename-list 

Description:

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"}


Disassemble File

Purpose:

Disassembles the specified file(s).


Disassemble File filename-list 

Description:

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"}


Make Project

Purpose:

Makes the current project.


Make Project [with ExternalEditor]

Description:

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'.


Precompile

Purpose:

Precompiles the specified file.


Precompile source saving as destination [ with ExternalEditor ]

Description:

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


Preprocess

Purpose:

Preprocesses the specified file.


Preprocess source [ with ExternalEditor ]

Description:

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


Remove Binaries

Purpose:

Removes the binary object code from the current project.


Remove Binaries

Description:

Performs the equivalent of the Remove Object Code command in the Project Menu.

Returns:

None.


Remove Object Code

Purpose:

Removes the binary object code from the current target or project.


Remove Object Code

Description:

Performs the equivalent of the Remove Object Code command in the Project Menu.

Returns:

None.


Run

Purpose:

Runs the current project or target.


Run

Description:

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.


Run Project

Purpose:

Runs the current project


Run Project [ with ExternalEditor ] [ with SourceDebugger ]

Description:

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 with SourceDebuggerRun Project with ExternalEditor


Touch

Purpose:

Touches the specified file(s).


Touch filename

Description:

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" }


Update Project

Purpose:

Updates the current project.


Update Project [ with ExternalEditor ]

Description:

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'.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 02, 2000