Dear all,
Let me first repeat my previous question and the solution, then post my
follow-up question.
My previous question was:
> I am writing an S-Plus (version 6.1) function on Windows to call a
> Fortran code. The Fortran code has something like below:
>
> if(aaa)then
> stop
>
> The compiled S-Plus function works fine except that whenever aaa is
> TRUE, The Fortran subroutine exits AND the S-Plus session is shutdown
> and I have to restart S-Plus. I just do not like this.
>
> My question is how should I change the Fortran code or S-Plus
> code such
> that the Fortran subroutine exits but my S-Plus session is
> still alive.
A quick solution was
if(aaa)then
return
I found maybe I did not post all related original lines, as follows.
if(aaa)then
stop
end if
call nextroutine
So the lines become, after replacing "stop" with "return":
if(aaa)then
return
end if
call nextroutine
Now here is what I found: I believe the program did not exit. In fact it
still ran "nextroutine" and gave me the results, which I did not expect
to have.
Thanks for any advice.
--
Zhu Wang
Statistical Science Department
Southern Methodist University
Dallas, TX 75275-0332
|