- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
INQUIRE(FILE=DsnProfExportName, EXIST=FILE_EXIST)
IF (FILE_EXIST) THEN
OPEN(90,FILE=DsnProfExportName, STATUS='OLD', ERR= 100)
END IF
....
!Error trap
100 ErrorFound = .TRUE.
I thought the "ERR=100" would be able to trap an error such as when the file is already open in Excel but instead of going to statement 100, the runtime crashes on the line with the OPEN statement and displays: "forrtl: severe (46): inconsistent OPEN/CLOSE parameters, unit 90, file unknown"
If the "ERR=xxx" can't catch if the file is already open in another process is there a way to at least detect an already open file (especially one that is write protected)?
Thanks!
Lawrence
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply, you are right! when I'm working on a machine that is installed windows 7, it works and I do not have this message ! but with windows 8 i have this error. So, what I can do to avoid that ?
Thanks, App4619!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that this type of error is related to windows 8. My question is: How I can to compile a code f77 on Microsoft Visual Studio ? (when i open a new project, directly the format is f90! so i can not bluid a project on f77
Thank you for your help.
- 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
Thank you Steve,
Good, I chose the option of fixed-form source and i write a simple program in f77. Now, how could i compile this program built it and run it ?
Program test
C------- DECLARATION ------------
INTEGER I IT
REAL AMPLI(10),T,FREQ,pi
C------- INITIALISATION ---------
FREQ = 50
pi = 3.1416
IT = 0
C-----THE BODY OF THE PROGRAM----
DO I =1,10
IT = IT + 2
T = FLOAT(IT)
AMPLI(I) = SIN(2*pi*FREQ*T)
WRITE(*,100) IT
ENDDO
100 FORMAT(1X,I2)
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Select Build > Build Solution in Visual Studio. It's no different than building free-form source. I assume that you took this code and added it into a fixed-form source file that is in a Fortran Console Application project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when I select Build, I have only one choice "execute code analysis on the solution Alt+F11" !
In free-form, it is very simple : when I create a new Projet, and I select 'Main Program Code', and I write my code, so in Solution explorer these is :
Header Files
Resources Files
Source Files
ReadMe.txt
In Free Form I can easily Build the solution and run it.
But in Fixed form, there is only "Solution(0projets)" so I can not Build this Solution!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right click on the project, select Add > Existing Item. Select your source file and click Add. Or in the future, select Add > New Item. Then when the Intel Visual Fortran Project Items dialog comes up, select "Fortran Fixed-Form file".
Alternatively, let the project wizard create the new project with free-form source. In the Solution Explorer, right click on the file and select Rename. Rename it to a .for file. Now it is fixed-form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your hep Steve.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »