replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - %bg not working with version 9.10
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 

%bg not working with version 9.10

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
simon



Joined: 05 Jul 2006
Posts: 297

PostPosted: Tue Mar 04, 2025 12:03 am    Post subject: %bg not working with version 9.10 Reply with quote

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


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

PostPosted: Tue Mar 04, 2025 8:28 am    Post subject: Reply with quote

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


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

PostPosted: Tue Mar 04, 2025 11:46 am    Post subject: Reply with quote

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


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

PostPosted: Tue Mar 04, 2025 2:13 pm    Post subject: Reply with quote

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



Joined: 05 Jul 2006
Posts: 297

PostPosted: Tue Mar 04, 2025 4:18 pm    Post subject: Reply with quote

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


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

PostPosted: Tue Mar 04, 2025 4:24 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ 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