• Login
Community
  • Login

What format to save file to run?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 1.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    Nancy Bailey
    last edited by Feb 4, 2018, 10:04 PM

    I’m just doing basic modular programming for a class, what format do I save the file in to run the program? I’ve saved as html and it only displays the text, but doesn’t run the program.

    Example:

    Module Main()
    Declare Real kilometers
    Call showIntro()
    Display “Enter the distance in kilometers.”
    Input kilometers
    Call kilometersToMiles(kilometers)
    End Module

    Module showIntro()
    Display “This program converts distance”
    Display “in kilometers to miles. For your”
    Display "reference the formula is: "
    Display “miles = kilometers * 0.6214”
    End Module

    Module kilometersToMiles(Real kilometers)
    Declare Real miles
    Set miles = kilometers * 0.6214
    Display "That converts to ", miles, “miles.”
    End Module

    Thanks!

    C 1 Reply Last reply Feb 5, 2018, 11:15 AM Reply Quote 0
    • C
      Claudia Frank @Nancy Bailey
      last edited by Feb 5, 2018, 11:15 AM

      @Nancy-Bailey

      files are always stored as bytes, not as html, py, cpp etc… these are only file extensions
      to let the os know if there is a particular application which should be used to open
      such files. Like registering txt should always be opened with npp.

      In order to run code there need to be some kind of interpreter/compiler/linker available
      for your language. What language do you use and how are codes executed natively?

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • N
        Nancy Bailey
        last edited by Feb 5, 2018, 10:11 PM

        In order to run code there need to be some kind of interpreter/compiler/linker available
        for your language.

        Ahhh, I suspected. I’m new to all this and was confused because in class we “ran” pseudocode programs from npp (without programming in a proper language…maybe the computers in class have a plugin or setting that I don’t on mine??) and I thought I could do the same with these modules. Thank you for your time and information!

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors