View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 297
|
Posted: Tue Mar 04, 2025 12:03 am Post subject: %bg not working with version 9.10 |
|
|
The following program should create a window with a yellow background with FTN95, but in version 9.10 (and I think starting in version 9.05) the colour is no longer identified. I am aware that I am using routines ending in $. I do this because I am trying to use the code with other compilers, and in that case the program does produce the correct background colour.
The program also fails to switch off the cursor waiting status.
Code: | Winapp
Program cpt
Use clrwin$, Only: rgb$, set_cursor_waiting$, winio$
Integer :: icbg, iw
!
icbg = rgb$( 255, 255, 0 )
Call set_cursor_waiting$ ( 1 )
iw = winio$( '%za&' )
iw = winio$( '%bg&', icbg )
iw = winio$( '%ca@&', 'TEST' )
Call set_cursor_waiting$ ( 0 )
iw = winio$( '%zz' )
End Program cpt |
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Mar 04, 2025 8:28 am Post subject: |
|
|
Simon
The $ forms of the mod files are no longer directly supported and are no longer included in the release. The source code for the module must be imported into the project or included in the file.
RGB$ appears to be broken and I will look into this.
This works for me...
Code: | Winapp
include "C:\Program Files (x86)\Silverfrost\FTN95\source64\clrwin.f95"
integer function rgb(r,g,b)
integer r,g,b
rgb = r + ishft(g,8) + ishft(b,16)
end function
Program cpt
Use clrwin$, Only: rgb$, set_cursor_waiting$, winio$
Integer :: icbg, iw, rgb
icbg = rgb(255,255,0)
Call set_cursor_waiting$ ( 1 )
iw = winio$( '%za&' )
iw = winio$( '%bg&', icbg )
iw = winio$( '%ca@&', 'TEST' )
Call set_cursor_waiting$ ( 0 )
iw = winio$( '%zz' )
End Program cpt |
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Mar 04, 2025 11:46 am Post subject: |
|
|
Version 9.10 of FTN95 includes the VALUE attribute from the 2003 Fortran standard where a copy of the argument is passed by reference.
At first sight it seems that allowance has not been made in v9.10 for the existing use of VALUE within an ISO_C_BINDING interface where VALUE denotes an argument that is passed by value.
This will cause RGB$ to fail and the same will be true for any ISO_C_BINDING routine that accesses a C library using pass by value.
This failure is currently being investigated. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Mar 04, 2025 2:13 pm Post subject: |
|
|
This failure has now been fixed for the next release of FTN95.
The fault occurs when reading a module that contains an interface for a routine with a "BIND C" VALUE argument (it occurs within the USE statement).
Supported users with version 9.10 of FTN95 who are not able to work around this failure should send me a personal message on this forum. |
|
Back to top |
|
 |
simon
Joined: 05 Jul 2006 Posts: 297
|
Posted: Tue Mar 04, 2025 4:18 pm Post subject: |
|
|
Hi Paul,
Many thanks for investigating this. I should have noted that I do import the source of clrwin into my code, but, as you mention, there are some remaining issues. Is there a list of what other routines might be affected?
Thanks,
Simon |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Mar 04, 2025 4:24 pm Post subject: |
|
|
Simon
If you look at the source code you will be able to see all the routines that have "BIND C" and arguments that are passed by value. |
|
Back to top |
|
 |
|