- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A past forum discussion concerned the use of the SAVE statement without any objects specified (or blanket SAVE)in data modules. I believe the conclusion of the discussion was that the SAVE statement is not needed in data modules because modern compilers would ensure that the data is saved. Is thiscorrect, or is it good programming practice toinclude the blanket SAVE statement just in case?
Thanks for any info.
Link Copied
- 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
On page 342 in Chapman's 'Fortran 90/95...', he states, 'You may use modules to pass large amounts of data between procedures within a program. If you do so always include the SAVE statement witin the module....'
However, the previous posts I refered to, 'Save-statement' posted on 03-29-2004, left me a little confused about the use of the SAVE statementwithout a variable list.
For a win32 program, I have a ModuleGlobalswith NOblanket SAVE statement in the MODULE. Some of the variables are initialized in the module and some are not. But, of course I would like them all to be saved.
From your reply, Iunderstand that it would be prudent to use either the SAVE statement (without a variable list), or to use the SAVE attribute for each uninitialized variable in the global module to ensure that all the variables are saved?
If so, is there a preference (SAVE statement, or SAVE attribute)for global modules that have some variables initialized and others not initialized?
Notethat the IVF win32 project template for the globals module did not includea SAVE statement.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the practical side, our implementation always saves module variables, but if a module is not to be referenced by the main program, then it is a good idea to add SAVE if that's what you want. The project template does use the module in the main program, soi SAVE is not required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page