- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lots of ways of getting the current date and time but how about when it was compiled?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you try something along the lines of
program datetime
character(len=80):: datetimestring=__DATE__//' '//__TIME__
write(*,*)datetimestring
end
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These work with FPP enabled
write(*,*) __DATE__
write(*,*) __TIME__
#define __TIMESTAMP__ __DATE__//' '//__TIME__
write(*,*) __TIMESTAMP__
write(*,*) __FILE__
write(*,*) __LINE__
Note, __LINE__ is an integer not a text string as are the others.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since you are reluctant to use FPP (Fortran PreProcessor)...
Create a batch file of the name IFORT.BAT and place in PATH(or current directory) such that IFORT.BAT is run in lieu of IFORT.EXE. The batch file will run whenever a file (or files) are to be compiled. The batch file is written such that for each source file being compiled that a call to a program of your writing is made to auto edit the file to locate placed to insert the __FILE__ and or __LINE__ information.
if(SomethingBad) call BUG("me",0,"SomethingBad happened") ! __FILE__ __LINE__ (and __DATE__ __TIME__ __DATETIME__)
Where the source file is searced for lines containing__FILE__ and or __LINE__ (and __DATE__ __TIME__ __DATETIME__)
If any present the line is researched for CALL. The subroutine name is ignored and then the 1st token is replaced with the enquoted file name and the second token is replaced with the line number. (you get the idea).
When the edit program is complete then the batch file runs IFORT.EXE from the IVF BIN directory.
This will modify files (to be compiled). Therefore a rebuild all will force changes into the source files (not a good idea).
The alternative would be to produce a different output file from the original input file and have IFORT compile that instead (essentialy what FPP does).
A third alternative is to replace FPP.EXE with your own program (which performs the edits as discussed above).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
The problem you have with that method is the include file becomes a file on which your source (having the include) is dependent. Therefore a build causes all files with that include to become stale (i.e. will require building on the next build).
I don't know if exclude from build also means exclude from dependency check.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim,
As long as the include file is updated as a Pre-Build Event, then the updates to the dependencies should occur during this build. It gets a little tricky, however, if you have mulitple projects in a solution, as the Pre-Build Event is specific to one project. If that project isn't built this time around, the include file is not updated.
I have built a small routine today (in Fortran) to edit the .rc file to update the build number within version number and to write an include file with the create date set as a parameter character string which can be used by the App.
regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That may be suitable for the build date of the execuitable or lib but it is not suitable for the compile date and time of the constituent .OBJ files going into the execuitable or lib.
Inside the .OBJ file is the information you need to go into the RC file or into the execuitable (where the RC data resides). Using DUMPBIN you can find the time and date stamp within the .OBJ file
FILE HEADER VALUES
14C machine (x86)
6 number of sections
46AE4937 time date stamp Mon Jul 30 15:25:27 2007
Just prior to link you could concievably collect the OBJ file names along with the time date stamps and place them in the RC area. Then add to the About box a feature to display this information.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David,
I forgot to add.
Editing the RC file might cause build to perform a new link as opposed to a do nothing if everything (else) is up to date. Not entirely bad.
A better route might be: when anything built - edit the RC info inside the .EXE file. Or simply concatinate the text file containing the information you wantto the tail end of the .EXE file. That's essentially how the RC file(s) are added onto the execuitable.
Jim
![](/skins/images/8B6E2C8F64F54CBD7F7262AA46F575DA/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page