dgurok
Joined: 26 May 2011 Posts: 66
|
Posted: Fri Feb 05, 2016 9:37 am Post subject: Access Violation on STOP |
|
|
Dear Paul,
in one of our applications we get an access violation when we try to close the application while using STOP. For testing we have compiled all sources with option /undef but the application works fine. Only when we try to close the application the problem occurs. STOP/END is the last code sequence of the program.
Do you have an idea what the problem could be?
We use FTN95 Ver. 7.10.0
:edit
We have figured out that this problem has something to do with WINIO using %HW, %LW and OPEN_TO_WINDOW@. The code is very old but until now we had no problems with it. Maybe OPEN_TO_WINDOW@ is not needed in our case no more...
In the debbuger the problem does not occur. It happens most of the time during run time. Very strange behavior. |
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Feb 05, 2016 5:04 pm Post subject: |
|
|
This looks like the problem you get when the return code path is no longer available. Explaining it simply (which is the way I understand it!) if you have
ii = winio@ ....
and ii is a local variable, then it may no longer be a valid place to put the winio@ exit code as everything shuts down - including the window accepting fortran output.
My solution when I had a similar problem was to SAVE things, either whole blocks of subroutines, or just the return variables, or put them in COMMON blocks. Which you choose depends on your programming style. If you use lots of local variables, the the compiler SAVE option may not be helpful.
You might just need to explicitly close down that window by finding its handle and operating on that.
Eddie |
|