Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Visual Fortran dialog box

ekeom
Novice
686 Views
Hello,

I would like to write an interactive program, as show in the example.

program xxx

.
.
.
i = function of some parameters
.
.
.
if(i>0) then

display message & dialog box
' (i>0) do you want to continue '
(click - YES or NO - )
if YES jump to continue label
if NO execution if interruted

endif

continue

.
.
.
end xxx

Can someone help for this. Thank you for Your help.

Didace
0 Kudos
2 Replies
anthonyrichards
New Contributor III
686 Views
Use MESSAGEBOX, which you will find in module USER32,
which can be obtained by adding USE DFWIN to your
calling code
use dfwin
use dfwinty ! loads parameter definitions
! for MB_YESNOCANCEL, IDYES etc.
integer hWnd ! hWnd Can be NULL
integer iret
character*100 lpszMessage, lpszHeader
if( i.gt.0) then
lpszMessage = "(I>0), Do You want to continue"C
lpszHeader = "ERROR MESSAGE"C
! If hWnd is null, the message box has no owner window...

iret = MessageBox (hWnd, &
lpszMessage, & lpszHeader, & IOR(MB_SYSTEMMODAL, & IOR(MB_YESNOCANCEL)) ) endif

if(iret.eq.IDCANCEL) then
...

else if(iret.eq.IDYES) then
...
else if (iret.eq.IDNO) then
...
endif

Message Edited by anthonyrichards on 08-26-2005 02:57 AM

0 Kudos
ekeom
Novice
686 Views
Thank you very much anthonyrichards for your answer.

Didace
0 Kudos
Reply