Topic: Prompt to Save

What do you do when you open a code in simply fortran, save and try to build but you keep getting a prompt to save?

I have saved the file over and over again but it won't compile and keeps popping up to save project before building.


Kindly help, I have an assignment to submit

Re: Prompt to Save

Is the popup asking you to save a project file with the .prj extension?  You need to use "Save Project" in the Project menu in that case.  However, that popup should just be a warning, asking if you want to proceed anyway rather than cancel the attempt to build.

The warning about an unsaved project should probably be a bit more explicit and allow saving immediately, though.  Simply Fortran isn't working nicely in this case.

Jeff Armstrong
Approximatrix, LLC

Re: Prompt to Save

Hi Jeff,

Thanks for your response.

So, I tried to save with the .prj extension and became worse. I compiled a previous code I had done that worked but after I used the .prj extension that code did not even work any longer.

My Mac is updated to the latest macOS Sequoia 15.0 so I thought I'd rather close simply fortran and reopen everything afresh, and when I did, the code saved, the compilation worked and I was able to run the code.

Re: Prompt to Save

I think you may have misunderstood me with the .prj extension.  When you save a project, it saves as a .prj file that references your Fortran source files (probably using .f or, hopefully, .f90 extensions).  That way, if you have multiple Fortran source files, all within the same project, Simply Fortran will compile them into a single executable.  You have to explicitly add files to a project, though, which you might not have done.  Did you see a long warning about no source files present?

The Project Outline panel will list the files in the current project.  A project can only have a single program in it.  In other words, a project can only contain one Fortran source file that has a program defined or it won't build.  But you do have to add files to a project, either in the Project menu or by right-clicking on a editor tab and selecting "Add <whatever> to Project."

So that's my explanation of projects.

Now if your Fortran code is all contained in a single Fortran source file, there's a very good chance you do not need to use projects at all.  Simply Fortran will try to work with you on this front, but the most reliable workflow is to use "Compile and Run Current File" in the Build menu if you want to avoid projects.  A lot of users do this.

Simply Fortran, though, does make some guesses if you just click the Build icon in the toolbar or select Build Project in the Build menu when a project isn't defined.  It tries to figure out if you mean the current file that is present in the editor.  However, if you have more than one file open, things can get confusing for it.  It might try to compile something you weren't expecting.  It may produce a warning about an unsaved file if any file, even one that isn't facing you at the moment, isn't saved.  It tries, but sometimes it fails.  That's why I'd say using "Compile and Run Current File" is your best bet.

Jeff Armstrong
Approximatrix, LLC

Re: Prompt to Save

One last thing: if you're ever in a predicament like you've described, take a quick screenshot of anything you might think is pertinent, such as a warning that popped up, the current state of Simply Fortran, etc., and send it to support@approximatrix.com.  Sometimes looking at what's wrong can be a lot easier for both of us than a description.  I'm happy to help whenever I can!

Jeff Armstrong
Approximatrix, LLC