- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recently stumbled upon a real gem in Quickwin: if you use compiler switch /fpscomp:filesfromcmd, then the statement OPEN (unit, FILE=' ') will bring up the windows file select dialog box for the user to search for and enter a file. This is far easier than using the API GetOpenFilename as described in one of the samples programs. I spen hours getting that to work--and here it is available with one line of code!
The documentation is almost nonexistent, nearly impossible to find, but it is mentioned under "fpscomp" (in the proverbial fine print).
I have two questions/requests about this feature:
1. Why does one need the switch fpscomp to obtain this behavior? Why couldn't it be standard in a Quickwin program?
2. The dialog that pops up has the default file mask of *.txt. Is there any way to control this? I had high hopes that FILE='*.DOC' (for example) might carry through to the dialog--but alas. Seems there should be some other way that is still easier than the API GetOpenFilename call.
Quickwin developers at Intel, take note!
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
- 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
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When FILE='fname' in an OPEN statement does not exist, I believe that the Fortran standard states that the resulting action is implementation-dependent.Where did you find text to support that belief? The book Fortran 2003 Handbook says.
9.5.1 Connecting a File to a Unit In what is probably the most common situation, the OPEN statement connects an external file to a unit. If the file does not exist, it is created.That action is quite different from the FPS one, and users may be unpleasantly surprised if non-compliant behavior were to be the default. (Things may be less of a problem if the OPEN statement has a STATUS clause.)
- 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
- 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
In this case it would be perfectly logical to pop up GetOpenFilename.Please keep in mind that there are other OSes than Windows, and that your programs would become non-portable if they relied upon on OS-specific routines such as GetOpenFilename. Secondly, as others have pointed out, the use of a GUI routine to cover deficiencies in a program raises new problems. How would your program with the call to GetOpenFilename run in batch mode? What if your program was part of a large task on a multi-CPU cluster that runs, say, every night? Which machine operator would get to choose a data file out of a list, and what if the file that should be read is located on a remote machine? You can, of course, build your own small file-processing package. In your Fortran code, check if the filename is blank at the OPEN statement and, if so, call the file-processing package to fetch you a non-blank filename by using a menu, a random-number generator, a list of preferred file-names, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony Richards wrote:I´m waiting for that too! I tried but failed... MarkusHas anyone here ever tried to use IFileOpenDialog, IFileSaveDialog etc.? They are Object-oriented methods and require knowledge and ability to handle new structures such as IShellItemArray. It's diabolical! I think you might have to learn how to use COM/AUTO programming using the Fortran Module wizard to really get into them - or for Intel to write some nice wrappers for them (hint?).
- 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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page