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.

MESSAGEBOXQQ problem

sammy
Beginner
547 Views
Can someone please tell me why this will not give me a New Line ( ) in a message box?
WRITE(message,'(A,I2,A)') 'Hole is less than 4" from end of plate on section #',NR,CHAR(0)
iret = MESSAGEBOXQQ(TRIM(message),'Warning'C,MB$ICONEXCLAMATION.OR.MB$OK)
0 Kudos
2 Replies
anthonyrichards
New Contributor III
547 Views

I use the Windows API function messsagebox(Hwnd, Message, Title, MB_ICONHAND etc. etc.)

andI find that escape sequences like , in Message don't work in that function either!

( i am using WIndows 2000, CVF6.6c)

0 Kudos
Jugoslav_Dujic
Valued Contributor II
547 Views

Escape sequences such as , etc work only if the containing string is appended with C in the code. e.g.

write(*,*) "First line Second line"C

(Note that this is a language extension). They do not work if you append char(0) by other means, such as WRITE or concatenation, e.g. the following is not equivalent:

write(*,*) "First line Second line"//char(0)

Compiler does not have a crystal ball to know how to interpret " ", i.e. whether you're going to append a char(0) or not.

In your case, you can simply use / format descriptor to obtain a new line. In more complex cases, consider sticking in char(13) or char(13)//char(10) (the latter is required for multi-line edit controls).
Jugoslav
0 Kudos
Reply