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

Multiline messages

Ted_Lillys
Novice
992 Views

I have small dialog project with an edit control into which I want to post formatted multi-line messages with place holders.  For example, a message might be:

6 Files were successfully loaded.

File Stub: (some string)

where bold text represent dynamic content. I tried write statements to a character variable with slashes (/) - that generates and error -forrtl: severe (27): too many records in I/O statement.  I thought of using a resource in a string table like "%n Files were successfully loaded.\nFile Stub: %s", but not sure how to use LoadString to supply the variables as arguments to fill in the % place holders.

Any suggestions?

Ted

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
992 Views

Swap the char(..)'s

CRLF is char(13)//char(10)
LFCR is char(10)//char(13)

Generally from a console app (CMD window), the order of CR and LF does not matter.

Windows dialog box may be goofy in this respect.

Jim Dempsey

 

View solution in original post

0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
992 Views

Insert CR-LF pairs into the string where you want line breaks. (Use A format.) Internal I/O won't do this for you on record boundaries (that starts a new array element.) 

0 Kudos
Ted_Lillys
Novice
991 Views

Thanks Doc. I tried a number of things but haven't been successful (and thick apparently). I've attached captures of the dialog, properties and results of a test

This was one attempt to create two strings and concatenate them in DlgSet().

character(len=max_name_length):: stub, tempstr1, tempstr2
.
.
write(tempstr1,'(i2," RWB Files Selected Successfully")') nfiles
write(tempstr2,'("File Stub:",A15)') TRIM(stub)
retlog = DlgSet(gdlg, IDC_EDIT_PROCESS_RESULTS,TRIM(tempstr1)//char(10)//char(13)//TRIM(tempstr2)//char(0))

The results for one test should be:

8 RWB Files Selected Successfully

File Stub:        LFNL_R4      

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
993 Views

Swap the char(..)'s

CRLF is char(13)//char(10)
LFCR is char(10)//char(13)

Generally from a console app (CMD window), the order of CR and LF does not matter.

Windows dialog box may be goofy in this respect.

Jim Dempsey

 

0 Kudos
Ted_Lillys
Novice
992 Views

 Jim - thank you.  Definitely goofy.

 

0 Kudos
Reply