Using Notepad

Author: Frank Hunt
Date Of Creation: 14 March 2021
Update Date: 1 May 2024
Anonim
How To Use Notepad++ | Programming Tutorial for Notepad++
Video: How To Use Notepad++ | Programming Tutorial for Notepad++

Content

This wikiHow teaches you how to install and use Notepad ++ on your Windows computer. Notepad ++ is a word processor optimized for programming languages, making it ideal for coding in languages ​​such as C ++, Batch and HTML.

To step

Part 1 of 5: Install

  1. Open the Notepad ++ website. Go to https://notepad-plus-plus.org/ in your browser.
  2. click on Download. This tab is located at the top left of the page.
  3. click on To download. It's a green button in the center of the page. The Notepad ++ installer will start downloading.
    • Depending on your browser settings, you may need to select a save location or confirm the download before you can continue.
  4. Double click on the setup file. It looks like a green frog.
  5. click on Yes to confirm. The installation window will open.
  6. Select a language. Click on the language selection menu and then click on the language you want to use.
  7. click on OK. It's at the bottom of the Language window.
  8. Follow the instructions on the screen. Do the following:
    • click on Next one
    • click on agreement
    • click on Next one
    • click on Next one
    • Check the advanced options and then click to install.
  9. click on Shut down. If you keep the option "Run Notepad ++" checked, this will both close the installation window and open Notepad ++.

Part 2 of 5: Setting up Notepad ++

  1. Open Notepad ++ if it is not open. Double-click on the Notepad ++ app icon, a white rectangle with a green frog on it.
  2. Delete any text that may be present in Notepad ++. Normally you'll see some developer notes here, so just select and delete those.
  3. click on Settings. This tab is located at the top of Notepad ++. When you click on this, a drop-down menu will appear.
  4. click on Preferences .... It's in the menu Settings. The Preferences window opens.
  5. View the settings of Notepad ++. View the settings in the center of the window, or click a tab on the left side of the preferences window to change the category of settings you are viewing.
    • You can change these settings as you wish, but be careful not to change anything you don't understand.
  6. Click Close. It's at the bottom of the preferences window. This saves any changes and closes the window.
  7. Check out the menu buttons. At the top of the Notepad ++ window you will see a row of colored buttons. Move your mouse over each of the buttons to show what each button does.
    • For example, the purple floppy disk icon at the top left of the window saves your project progress when you click on it.
  8. Choose a programming language. This article covers examples for C ++, Batch and HTML coding, but you can work in almost any programming language with Notepad ++. Once you've chosen a programming language, you can proceed to actually use Notepad ++ to create a program.

Part 3 of 5: Creating a simple program in C ++

  1. Click on the tab Language. It's at the top of the window. When you click on it, a drop-down menu will appear.
  2. Select C.. You can find this option in the Language-menu. A submenu will appear.
  3. click on C ++. It's in the submenu. Most programmers' first experiences with C ++ involve creating a program that says "Hello, World!" When it runs, so that's what you're going to do here.
  4. Add a title to your program. Type // followed by the title of your program (eg "My First Program"), then press ↵ Enter.
    • Text in a line typed after two slashes is not read as code.
    • For example, to name your program "Hello world", type // Hello world in Notepad ++.
  5. Enter the command from the preprocessor. Type #include iostream> in Notepad ++ then press ↵ Enter. This command instructs C ++ to run the following lines of code as a program.
  6. Declare the function of the program. Type int main () in Notepad ++, then press ↵ Enter.
  7. Add a start curly brace. Type {in Notepad ++ then press ↵ Enter. The main code of your program will later be placed between this start brace and an end brace.
  8. Enter the actual program. Type std :: cout "Hello World!"; in Notepad ++ and press ↵ Enter.
  9. Add an end brace. Type} in Notepad ++. This concludes the implementation phase of the program.
  10. Check your program. It should look something like this:
    • //Hello World
    • #include iostream>
    • int main ()
    • {
    • std :: cout "Hello world!";
    • }
  11. Save your program. click on File and then on Save as… from the drop-down menu, enter a name for your program, select a save location and click Save.
    • If you have a program on your computer that can run C ++, you should be able to open this "Hello World" program with it.

Part 4 of 5: Create a simple batch program

  1. Click on the tab Language. It's at the top of the window. When you click on it, a drop-down menu will appear.
  2. Choose B.. You can find this option in the Language -menu. A submenu will appear.
  3. click on Batch. This is in the submenu. Batch is a modified version of the commands you use in the command prompt, so each batch file will open in the command prompt.
  4. Type the command "echo". Type @echo off in Notepad ++ and press ↵ Enter.
  5. Give your program a title. Type title text and press ↵ Enter, replacing "text" with your desired title.
    • When you run the program, the title will be displayed at the top of the command window.
  6. Enter the text to be displayed. Type echo text and press ↵ Enter. Replace "text" with the text you want to display in the command prompt.
    • For example, if you want to display the text "People are superior!" In the command prompt, type echo People are superior! in Notepad ++.
  7. Stop the program. Type pause in Notepad ++ to tell the program to stop.
  8. Check your code. It should look something like this:
    • @echo off
    • title Improved command prompt
    • echo People are superior!
    • pause
  9. Save your program. click on File, Then on Save as…' from the drop-down menu, enter a name for your program, select a save location and click Save.
    • If you want to run your program, go to the location indicated and double-click the file.

Part 5 of 5: Creating a simple HTML program

  1. Click on the tab Language It's at the top of the window. When you click on it, a drop-down menu will appear.
  2. Select H.. This option is in the Language-menu. A submenu will appear.
  3. click on HTML. It's in the submenu. HTML is often used for web pages, so you create a basic web page with heading and sub-heading.
  4. Enter the document header. Type! DOCTYPE html> in Notepad ++, then press ↵ Enter.
  5. Add the tag "html". Type html> in Notepad ++ and press ↵ Enter.
  6. Add the "body" tag. Type body> in Notepad ++ and press ↵ Enter. This indicates that you are going to post a piece of text or other content.
  7. Type the header of the page. Type h1> text / h1> and press ↵ Enter, making sure to replace "text" with a heading for the page of your choice.
    • For example, to set your header as "Welcome to my swamp", you could enter h1> Welcome to my swamp / h1> in Notepad ++.
  8. Place the text and other content under the heading. Type your p> text / p> and press ↵ Enter. Replace "text" with text of your own choice (eg, "Make yourself at home!").
  9. Close the "HTML" and "Body" tags. Type / body> and press ↵ Enter and then type / html>.
  10. Check your code. It should look something like this:
    • ! DOCTYPE html>
    • html>
    • body>
    • h1> Welcome to my swamp / h1>
    • p> Make yourself at home! / p>
    • / body>
    • / html>
  11. Save your program. click on Filethen click Save as… from the drop-down menu, enter a name for your program, select a save location and click Save.
    • As long as you select your language for saving, Notepad ++ will choose the correct file format for you.
    • You should be able to open your HTML file in any web browser.

Tips

  • Notepad ++ uses tabs to hold different types of content, so if Notepad ++ crashes, your work will probably still be available when you reopen this program.

Warnings

  • Selecting the wrong extension for the programming language used will lead to errors when executing the program.
  • Always test your program before showing it to other people. This gives you the chance to fix any issues or make any necessary adjustments.