forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Black "DOS" box and redirection to %cw

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Mar 04, 2024 10:23 pm    Post subject: Black "DOS" box and redirection to %cw Reply with quote

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
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Tue Mar 05, 2024 1:07 am    Post subject: Reply with quote

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 Smile But only then
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Mar 05, 2024 1:51 am    Post subject: Reply with quote

Dan,

Yeah, tried that already. No dice.

Bill
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Tue Mar 05, 2024 2:08 am    Post subject: Reply with quote

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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Mar 05, 2024 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7926
Location: Salford, UK

PostPosted: Tue Mar 05, 2024 8:08 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Mar 07, 2024 10:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun Mar 10, 2024 12:35 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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