1 (edited by JohnWasilewski 2017-02-23 23:44:19)

Topic: "Project modified" flag detection on first opening exstg project

Ver 2.34, Windows.

I have just encountered an unexpected condition.  The occurrence ir extremely trivial, and it may even be that this is intended SF behaviour, but, intuitively, it seems a bit strange, so I'm reporting it just in case there's some kind of very small small fault.

Sequence of actions:
(1) booting the laptop from 'off' (ie not just bringing it back from 'sleep' or 'hibernation'.).
(2) starting SF by double-clicking the SF icon (ie SF not already running and brought to the front);
(3) opening an existing project by double-clicking it in the SF 'Recent Projects' list;
(4) trying either to (a) RUN the program or (b) BUILD the executable:

Result straight after (4):
"Error: please save the Project before proceeding".

This seems odd.   At the moment of starting SF, none of the files for any of the projects has been opened yet.  When then initiating  a  project-opening action, all of the source files and project data files in that selected project are still in a closed state.  I assume that opening the project opens the .prj file, so that SF can read the list of files it is going to need, and maybe that it opens the source files and starts syntax checking if necessary, but none of the source files or any other project data files has yet been opened for editing.

I could understand this msg if, immediately after opening the project, I had edited a file or two and had then tried to RUN or BUILD without first saving, but when all files are in the as-just-opened and un-tempered state, I am not expecting to see this message.

What MIGHT have happened is that I might have shut-down the laptop without first saving a project properly or at all (I don't recall whether I did this, but it is a distinct possibility).  What I know I did not do is just to cut the power.  I certainly did a proper shut-down, but I then left it to shut down and I didn't monitor it for any "do you want to save files?" prompts.  If my actions did focibly close SF with an unsaved project, I'd expect all files to have been forcibly but properly closed, losing any changes I'd made. 

In being prompted now to save a project I've only just opened, I am surely being prompted to do something that does nothing at all.  My guess is that a forced shut-down might have left the .prj file or some log file somewhere in the system out of sync with the project source files. 

I've rambled on for too long and this is getting incoherent, so I'll stop.  Needless to say, I was able to clear this slight hiccup very easily, and I am reporting it now only in case it is useful feedback, Jeff.
---
John

Re: "Project modified" flag detection on first opening exstg project

John,

Simply Fortran doesn't maintain any sort of state that would persist if the computer were suddenly shut down. There is a "project modified" flag internally that is, for one reason or another, triggering when the project is loaded.  This flag is obviously set to "False" when the project is loaded, so I'd have to see where and why it is set to "True" after loading a project.  It would have nothing to do with how Simply Fortran last exited, though.  It is solely related to some sort of internal bug.

Is this project created or edited on Linux by any chance?  I'm just trying to think of a situation where Simply Fortran would override a project's options upon loading, triggering the "modified" flag.  Could you possibly email me the project file (no source code, just the .prj that exhibits this if you haven't already saved over itself?

Jeff Armstrong
Approximatrix, LLC

Re: "Project modified" flag detection on first opening exstg project

It is a project I have in both Linux and Windows, but I'd been using it lately, only in Windows.  I had cleaned up the problem so the project file was not going to be helpful.

However, by deliberately abusing SF, I've managed to create it again.  I did so this time by CLEANing a big project and then using Task Manager to kill SF deliberately, mid-way through re-BUILDing the project.  I can assure you this was not what I was playing at when it first happened, yesterday!

Obviously the project is in a mess, but the error message should still not be displayed, asking me to save the project, when I've only just opened it.  What I've noticed is that only the MAKEFILE has an immediate-past timestamp.  The .prj file was old.  I'm sending you both of them.

Jeff, this really is an obscure problem.  Don't work to hard to fix it!  We all know that when daft things are happening, just to CLEAN and re-BUILD all.  Like switching off the power and switching it on again when anything starts behaving erratically.
---
John