Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    What format to save file to run?

    Help wanted · · · – – – · · ·
    2
    3
    1216
    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.
    • Nancy Bailey
      Nancy Bailey last edited by

      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!

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @Nancy Bailey last edited by

        @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
        • Nancy Bailey
          Nancy Bailey last edited by

          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
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors