- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone please tell me why the following code is not writing a multiline edit box? I have selected the multiline options in properties.
write (text, '(f6.4)') sigma
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') delta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') theta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f5.1)') Temp
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.3)') Press / 144
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(ES10.3)') Rho * 32.172
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f8.3)') C
lret = DlgSet(dlg, IDC_EDIT_TEST, text)
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') delta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') theta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f5.1)') Temp
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.3)') Press / 144
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(ES10.3)') Rho * 32.172
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f8.3)') C
lret = DlgSet(dlg, IDC_EDIT_TEST, text)
Thank you,
David
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The content of an edit box has no concept of multiple "lines", it's only a single contiguous buffer. If the buffer content contains crlf, this is interpreted as "start a new line" when the (printable) text is printed in the box (ie, the multiline flag has been checked).
Hence you want to createone big buffer, fill it all in advance, and then write it once to your editbox, eg
character(len=300) :: text
character(len=2), parameter :: crlf = char(13)//char(10)
...
write (text,'(10(F6.4,A))') sigma,crlf,delta,crlf,theta,crlf,temp.... etc.
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(0))
Altho off-topic, I mustcomment thatthis would not be a very "friendly" or useable GUI; much better to have separate small data entry controls for each variable, if the idea is that they can be changed independently by the user. Also makes the coding much clearer, easier to maintain, etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To David: it is possible to append to existing multi-line box without your own bookkeeping, but you have to use Win32 APIs. (Actually, DlgSendCtrlMessage + EM_* nessages). See this recent thread.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I finally got it to work the way I want.
David

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page