WORKING WITH FILES

11.3 WORKING WITH FILES

The following editor features are available for working with files: • Creating a New File

• Opening Files • Printing Files • Saving Files • Closing Files • Syntax Type • Using Bookmarks

11.3.1 Creating a New File

To create a new file:

1. Click the New File icon, select New from the File menu or press <CTRL> + <N>.

2. A new window will open named “Untitled”. This is your new file. To give it the name you want it to have, select File>SaveAs.

11.3.2 Opening Files

To open an existing file:

1. There are two ways to select an existing file to open. - Click the Open File icon, select Open from the File menu or press <CTRL> +

<O>. The Select Input File dialog opens. In the dialog, browse to the location of the file you want to open and select it. Click the Open button.

- Select the file from the Project Tree by double clicking on it.

2. The selected file is displayed in its own editor window. If the selected file is already open, its current editor window will become the active window.

11.3.3 Printing Files

To print an open file:

1. Make sure the window that contains the file you want to print is the active window.

2. Click the Print icon, select Print from the File menu or press <CTRL> + <P>. The Print dialog box is displayed.

3. Select the print options you want and click OK. The file is printed on the selected printer.

DS51519A-page 154

 2005 Microchip Technology Inc.

Using the Editor

11.3.4 Saving Files

To save a file:

1. Make sure the window that contains the file you want to save is the active win- dow.

2. Click the Save icon, select Save from the File menu or press <CTRL> + <S>. The file is saved with the name on its window.

To save a file with a different name:

1. Make sure the window that contains the file you want to save is the active win- dow.

2. From the File menu, select Save As. The New File Name dialog displays.

3. In the dialog, browse to the folder where you want to save the file.

4. In the File Name field, modify the name of the file if you want to save the file with

a different name.

5. Click Save.

11.3.5 Closing Files

There are several ways of closing a file, as shown below: • From the File Menu:

- Make sure the window containing the file you want to close is the active win-

dow. - From the File menu, select Close. If the file has changed since it was saved

last, you will be prompted to save your changes. • From the System Button on the file window, select Close. • Click the Close Button on the file window. • Type <CTRL> + <F4> when the file you want to close is the active window.

11.3.6 Syntax Type

For the purposes of syntax coloring, the MPLAB Editor recognizes the syntax of various assemblers and compilers. You may specify the language type a source file contains.

1. Right-click in the file for which you wish to set the syntax type.

2. Select Text Mode from the right-mouse button menu in an editor window. You will get a menu containing the syntax types which the editor currently recognizes.

- Disabled – No text formatting. - PIC16C5x Asm – 12-Bit core MCU devices - PIC16Cxxx Asm – 14-Bit core MCU devices - PIC17Cxxx Asm – 16-Bit core MCU devices - PIC18Cxxx Asm – Enhanced 16-Bit core MCU devices - dsPIC Asm – dsPIC30F DSC devices - Asm Listing – Assembler listing - C – C language listing - Basic – Basic listing - SCL – Simulator Control Language listing

3. Select the closest matching language type for your file.

 2005 Microchip Technology Inc.

DS51519A-page 155

MPLAB ® IDE User’s Guide

11.3.7 Using Bookmarks

From the context (right-mouse) menu, select Bookmarks. Use bookmarks to easily locate specific lines in a file.

• Toggle Bookmark – Sets/removes an unnamed bookmark at the currently selected line.

• Next/Previous – Go to the next/previous bookmark. • Clear All – Clear all bookmarks.