Topic: another newbie question

Me again... 
I'm still learning Simply Fortran so please have patience with me.

Looking at John's SEGSIGV problem, I see where Jeff has written a Windows Dialog package and I said "Hey, I need that!".  So, I found the package installer, downloaded and installed it.  Now a dumb question--How do I use it to install packages?  Is it done outside of Simply Fortran, inside or is it a stand-alone program? (And I believe it requires a "USE pkg-name" in the using program.

Like I say - NEWBIE, NEWBIE, NEWBIE!!!

Don H.

Re: another newbie question

It's explained in the in-program 'help' file.  I don't have in front of me as I type this on an iPad but, as far as I can recall, as long as you have added APPGRAPHICS using the SF Package Manager, you just put, USE APPGRAPHICS near the start of every program which uses this library then put in as many sub program CALLs to the library as you like.

In case this doesn't work, you may need to provide some settings in the SF project options.  To find out what, if anything is needed, use the SF startup page to open one of the relevant examples, and look in the project options for the example you have selected.

If the above is all cobblers then I'm sure one of the other regulars to this forum will chip in with correct advice.

I hope you get it working because Jeff's APPGRAPHICS is a fabulous extension to SF, which, at a single extraordinary stroke, catapults SF from nowhere, fully into advanced Fortran-for-Windows programming.

By the way, the SIGSEGV problem I had when using the debugger to examine code containing a call to th DISLIN library to display a file selection dialog box, remains a problem when using a cal to AppGraphics to do the same thing.  On present evidence, it seems most likely that there's a bug in the 'DBG' debugger, not in SF, which is causing this.  It does not impede use of the file selection dialog in programs.  It just crashes the debugger.
---
John

Re: another newbie question

Thanks, John.  I'll see if I can track it down through help.

Don

Re: another newbie question

Don,

If you want to use packages with Simply Fortran, you'd need to first get a SF Package Manager account.  There are a number of useful, pre-configured packages available.

However, if you're looking for the file selection dialogs, you can simply use AppGraphics, which is included with Simply Fortran as of version 2.19.  The File Dialogs are explained int the Common Dialogs section.  Basically, all you would need to do is:

program fileselect
use appgraphics
implicit none

    character(len=256)::filename
    
    filename= repeat(' ', 256)
    if(dlgopenfile(filename)) then
         Print *, "You've selected "//trim(filename)
    else
        Print *, "No file was selected"
    end if

end program fileselect

As of version 2.20, you no longer need to set any other project flags.  When Simply Fortran detects you've used AppGraphics anywhere, it adds the appropriate flags to the Makefile.

Jeff Armstrong
Approximatrix, LLC

Re: another newbie question

Thanks Jeff.   Ready for the next question?  After I compile a module, if I go into it and make a change, if doesn't seem to accept the change.  It compiles okay, but when I run the program that uses that module, it acts like no change has occurred.  If I completely exit Simply Fortran and re-start it, do a clean and rebuild, it then works as it should.  It's acting like that the new compile is not updating the Modules folder (a total guess on my part, just going by the time I deleted all the .mod files, recompiled and got a working program).

Re: another newbie question

Don,

If you change a Fortran source file that contains a module, does building show that Fortran source file being recompiled?

The "modules" subdirectory contains only ".mod" files, which are products of compilation.  They are not the compiled code, though.  Rather, they represent a human-unreadable description of a module found in your Fortran source code.  When compiling Fortran source code that uses a module, the compiler will open the corresponding ".mod" file and read in the description of the module, including all public variables, types, and procedures.  Module files (the ".mod" files, not your Fortran source code) do not necessarily get recreated each time you build a source file.  They only get built if the public module description changed (like you added another public variable to a module).

I'm not sure why you're seeing the behavior you're describing.  Could you post the contents of your Makefile (from "View Makefile..." in the Project menu) and let us know which Fortran source file and module in said file that you're modifying?  I can then try to determine why the final target isn't updating when you change the source code.

Jeff Armstrong
Approximatrix, LLC

Re: another newbie question

Jeff
I'll see if I can reproduce it, but it will be tomorrow before I can try it.

Don

Re: another newbie question

If all you do is change the "inner workings" of a subroutine or function in a module, then an existing .MOD file isn't updated when you compile the corresponding Fortran source code file.

The .MOD file is only updated when you make a change to the source code which changes the interface to any of the public subroutines and functions (i.e. changing the name or argument list, adding new subroutines) or changes to public global variables.

To accomplish this, gfortran needs to read your .MOD files when compiling.

--
David