Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

SetExitQQ

wen
Beginner
631 Views
The following program is adopted from Intel Fortran Libraries Reference, Ch. 2, SetExitQQ, around p. 2-400.

program testSetExitQQ
use IFQWin
integer(4) modeEx, iRslt
do
print *, 'Enter exit mode 1, 2, or 3 '
read (*,*) modeEx
select case(modeEx)
case(1)
iRslt = setExitQQ(QWin$exitPrompt)
case(2)
iRslt = setExitQQ(QWin$exitNoPersist)
case(3)
iRslt = setExitQQ(QWin$exitPersist)
end select
end do
end program testSetExitQQ

No matter what number I input, the program keeps on running. Isnt it supposed to display a message box when the user enters 1? Isnt the program supposed to stop when the user enters 2?

Wen
0 Kudos
2 Replies
Steven_L_Intel1
Employee
631 Views
No. If you'll read the description again, SETEXITQQ changes what happens when the program exits - it does not itself cause the program to exit. The default is ExitPrompt. Most people like to use ExitNoPersist so that the window just goes away.

You call SETEXITQQ just once (typically at the start of the program). If you want the program to stop, either get to the END statement or use the STOP statement.
0 Kudos
wen
Beginner
631 Views
Thank you, Steve.
Wen
0 Kudos
Reply