Create File In Project

This method will create a new file and automatically add it to a project. There is a different method to create a file without adding it to a project.

1

Select Logical Folder where you want the file to be added

In the Projects Window, select the logical folder where you want the file to be added to the project when it is created.

ProjectsWindow.png
Click image to enlarge.

2

Launch the New File Wizard

Right click on the logical folder where you want the file to be created and select New ▶ FileType from the popup menu, where FileType is the kind of file you wish to create. Skip to step 4.

If no file types are listed in the popup menu or the kind you want isn't shown, select New ▶ Other… and go to step 3.

Alternatively, use one of the following commands and go to step 3:

Toolbar: Main_New_File.png
Keyboard: Ctrl+N
Menu: File > New File…
ProjectsRightClickNew.png
Click image to enlarge.

3

Choose File Type

a

Choose the Project into which you wish to add the file. If you selected a logical folder in step 1, this should already be set for you.

b

Choose one of the Categories of files you can create.

c

Choose one of the File Types you wish to create.

Files-NewFile1.png
Click image to enlarge.

4

Provide Name and Choose/Verify Location

a

Name your file in the File Name field.

b

Choose an Extension (e.g. ".c", ".cpp", etc.). In general, this should be set automatically to the correct extension based on the file type you created.

c

Choose a Location or Folder where the file should be created.

  • In the Location combo box, choose the physical location where you want the file saved. In general, the only option will be the project folder (HelloWorld in this example). However, if you have added any existing files or folders to the project that are not in your project directory, you can also select one of those locations to store the new file.
FileLocations.png
  • Optionally, select a subdirectory of the Location by clicking on the browse button next to the Folder combo box and picking a directory. The Created File item will show the full path for the new file to help you verify that you have chosen the options above correclty.

d

Click the Finish button.

Files-NewFile2.png
Click image to enlarge.

5

You should now see the new file in Projects Window under the logical folder you selected in step 1.

ProjectsWindow-End.png
Click image to enlarge.
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.