|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Mon Mar 04, 2024 10:23 pm Post subject: Black "DOS" box and redirection to %cw |
|
|
If this was answered in another earlier post, I apologize. I can't seem to find it.
---------------------
In porting my code to 64-bit, this is one of the items that didn't "port well".
After my code starts, I create a %cw inside of my main window so appropriate status messages can show up. The existing code just won't do it.
The code is:
Code: | call childwindow_setup(' ',child) ! this makes the basic ClearWin window for output capture
i = winio@('%ob[bottom_exit,line_colour]&',rgb@(255,69,0))
i = winio@('%120.35cw[hscroll,vscroll]&',0) ! attach to unit=0 to grab the output and direct it here
i = winio@('%cb&')
i = winio@('%ac[CTRL+C]&','COPY') ! attach the CTRL-C to this window
call child_complete_nohelp
|
I think I'm missing some important step in here.
Bill |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2863 Location: South Pole, Antarctica
|
Posted: Tue Mar 05, 2024 1:07 am Post subject: |
|
|
Bill,
Try unit = 0 in %cw change to 1 if what is not working is related to messages made by Print* or WRITE(*,*). I do not know why this change was ever made recently which makes this not compatible with the entire world. Will FTN95 soon beat the entire world? Then it's ok But only then |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Tue Mar 05, 2024 1:51 am Post subject: |
|
|
Dan,
Yeah, tried that already. No dice.
Bill |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2863 Location: South Pole, Antarctica
|
Posted: Tue Mar 05, 2024 2:08 am Post subject: |
|
|
Here is a piece i took out my code
Code: |
integer, parameter :: MaxLengOfFileNames=256
integer :: ixCurrTextWinpos3=200, iyCurrTextWinpos3=200
character*(MaxLengOfFileNames) CurrentDirectoryName, CURDIR@
integer (7) ihwMainTextWindow
integer lw_ctrl_txtw
........
........
iOUTun1=1
CurrentDirectoryName = CURDIR@()
........
........
i = WINIO@('ixCurrTextWinpos3, iyCurrTextWinpos3 )
i = winio@('%ca[Console1:'//trim(CurrentDirectoryName)//']%ww[no_border]&')
i = winio@('%mn[File[Exit]]&', 'exit')
i = winio@('%fn[Ubuntu Mono]%ts%bf%`bg%pv%128.20cw[hscroll,vscroll,local_font]&', 1.d0, rgb@(244,246,255),iOUTun1)
i = winio@('%ac[Esc]&','confirm_exit','C l o s e Text Window?')
i = winio@('%hw&',ihwMainTextWindow)
i = winio@('%lw[owned]', lw_ctrl_txtw) |
Change to your desired font
But if you want to create such special child window which will show the messages before main Clearwin window is created this my approach will not work
Last edited by DanRRight on Tue Mar 05, 2024 9:11 am; edited 9 times in total |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Tue Mar 05, 2024 2:19 am Post subject: |
|
|
Dan, thanks for that.
Still, using UNIT=1 for the attachment to %cw as a child window isn't working. I'll have to look into a different solution, perhaps using your basic code, to see what I can do.
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8011 Location: Salford, UK
|
Posted: Tue Mar 05, 2024 8:08 am Post subject: |
|
|
Bill
At first sight I don't think that you have supplied enough code for me to work out what is not working.
I would need a small working program using all of the required routines. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Thu Mar 07, 2024 10:05 pm Post subject: |
|
|
I have figured out what is apparently going on with this, and I think it's all me. That said, I'm hoping that within the 64-bit framework, I can duplicate what I have.
For my users, I send status messages to the embedded %cw window. At the same time, these messages (and those below the "display" threshold) go to a logging file that maintains a running commentary about what the user has selected, how that selection was processed, etc.
I wrote a special driver that takes the character strings and sends them to stdout and/or the logging file. The logging file is opened in "C". Output in "C" is the only output you can use within a special driver.
In 32-bit, FORTRAN unit 1 and the "C" standard output unit (stdout) happen to be "the same", meaning that within "C", if you send a string of characters to "stdout", it goes the same place as FORTRAN unit 1. So, messages being directed to be written to Fortran unit 1 OR through "C" get displayed on the %cw window.
In 64-bit, that linkage is different.
Now, anything written to stdout goes to the DOS command window, not to Fortran unit 1 which has been attached (maybe?) to the %cw. This includes "PRINT *" statements that do not use the special driver.
So, I'm still experimenting with %cw redirection, but am not confident I can duplicate what happens in 32-bit in this new environment. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1225 Location: Morrison, CO, USA
|
Posted: Sun Mar 10, 2024 12:35 am Post subject: |
|
|
So, in the documentation, if you link with /WINDOWS as an option, you'll not get the console opening up. That's good. Still working on the sequence of operations to get the standard output to the right %cw placement in my window. If you have any comments or tricks to help let me know.
I think the problem is that my initialization (i.e. reading a configuration file and resulting statements to output) might be pulling the re-direction away from my window because my window hasn't been fully created yet. And 32-bit and 64-bit might differ in the way the standard output gets "assigned" to a window anyway. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|