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

MESSAGEBOXQQ problem

sammy
Beginner
1,600 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
1,600 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
1,600 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