- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I get the error given in the headline when I try to run a program containing the following lines:
tmpline = 'if exist "'//filpid(1:i_dummy)//'"'//
# ' del /q "'//filpid(1:i_dummy)//'" > tmp'
call system(tmpline)
This is a program once compiled with an older compiler version. In a previous thread I have read that function calls are not longer allowed by the new compiler versions. So it is clear that this can not work using a new compiler version. But what would be the trick to gain the same result?
Bele
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SYSTEM is a function that returns an integer result, so declare a variable:
integer iret
and then change the call to:
iret = system(tmpline)
The Fortran standard does not allow calling a function as a subroutine. Indeed, earlier versions of our compiler did allow this, under some conditions, but the restrictions were not enough to avoid possible bad results and, after long debate, we decided that as the number of cases where this was harmless was small enough it was simpler to just make it an error. The problem has to do with mismatched assumptions about where arguments and return values get placed.
integer iret
and then change the call to:
iret = system(tmpline)
The Fortran standard does not allow calling a function as a subroutine. Indeed, earlier versions of our compiler did allow this, under some conditions, but the restrictions were not enough to avoid possible bad results and, after long debate, we decided that as the number of cases where this was harmless was small enough it was simpler to just make it an error. The problem has to do with mismatched assumptions about where arguments and return values get placed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the fast response!!!!

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