replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Bug %pl / change_plot_chr@ /64 bit
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 

Bug %pl / change_plot_chr@ /64 bit

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



Joined: 18 May 2012
Posts: 801
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sat Apr 19, 2025 9:48 pm    Post subject: Bug %pl / change_plot_chr@ /64 bit Reply with quote

In the following program a very simple graph is plotted using %pl. To the right of the plot there is a button �NEXT�, whose call back calls change_plot_chr@ and simpleplot_redraw@ to change the y_axis label on the %pl graph. This works updating the plot as expected.

However, when the window is closed after the button �NEXT� has been clicked on, an unknown exception is generated. If the calls to the function change_plot_chr@ in the function next_y_cb are commented out (so that the change of label is not applied) the unknown exception is not generated.

I have observed this with the 64 bit compiler, the 32 bit compiler does not fail in this way. Similar failures can be observed for changing the x_axis label and the title of the plot � again only with the 64 bit compiler.

Code:
module test_change_plot_chr
use clrwin
implicit none
integer :: plot_number = 1
real*8 :: x(2) = [0,1], y(2) = [0,1]

contains

 integer function start()
 integer :: iw
   iw = winio@('%mn[Exit]&','exit')
   iw = winio@('%fn[Tahoma]%ts%bf&',1.5d0)
   call winop@('%pl[n_graphs=1,native,x_array]')
   call winop@('%pl[Title="A simple graph"]')
   call winop@('%pl[yaxis="Frequency"]')
   call winop@('%pl[xaxis=" X "]')
   iw = winio@('%pl&',900,600,2,x,y)
   iw = winio@('%^bn[Next Y]', next_y_cb)
   start = 2
 end function start

 integer function next_y_cb()
 integer i
   plot_number = plot_number + 1
   if (plot_number .gt. 2) plot_number = 1
   if (plot_number .eq. 1) then
     i = change_plot_chr@(0,"y_axis",0,"Sin(x)")
   else
     i = change_plot_chr@(0,"y_axis",0,"Cos(x)")
   end if
   print*, i
   call simpleplot_redraw@()
   next_y_cb = 2
 end function next_y_cb

end module test_change_plot_chr

program p
use test_change_plot_chr
i = start()
end program p
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 801
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Apr 20, 2025 9:30 am    Post subject: Reply with quote

Taking another look this morning I see I was mixing options %pl[y_axis] and %pl[yaxis] in the code above.

Using "y_axis" only the following modified code still fails in the way I described above with the 64 bit compiler.

Code:
module test_change_plot_chr
use clrwin
implicit none
integer :: plot_number = 1
real*8 :: x(2) = [0,1], y(2) = [0,1]

contains

 integer function start()
 integer :: iw
   iw = winio@('%mn[Exit]&','exit')
   iw = winio@('%fn[Tahoma]%ts%bf&',1.5d0)
   call winop@('%pl[n_graphs=1,native,x_array]')
   call winop@('%pl[Title="A simple graph"]')
   call winop@('%pl[y_axis="Frequency"]')        !Change here
   call winop@('%pl[x_axis=" X "]')
   iw = winio@('%pl&',900,600,2,x,y)
   iw = winio@('%^bn[Next Y]', next_y_cb)
   start = 2
 end function start

 integer function next_y_cb()
 integer i
   plot_number = plot_number + 1
   if (plot_number .gt. 2) plot_number = 1
   if (plot_number .eq. 1) then
     i = change_plot_chr@(0,"y_axis",0,'Sin(x)')
   else
     i = change_plot_chr@(0,"y_axis",0,'Cos(x)')
   end if
   print*, i
   call simpleplot_redraw@()
   next_y_cb = 2
 end function next_y_cb

end module test_change_plot_chr

program p
use test_change_plot_chr
i = start()
end program p


Using "yaxis" only in the code, I see that
Code:
i = change_plot_chr@(0,"yaxis",0,'Sin(x)')

fails (returning i =5) I did not expect this to work since "yaxis" was added to the library after change_plot_chr@.

What I am trying to show in this second post is that the failure is not due to using
Code:
 call winop@('%pl[yaxis="Frequency"]')

before the graph is formed, followed by
Code:
i = change_plot_chr@(0,"y_axis",0,'Sin(x)')
in the callback.

The failure does not occur when using:
Code:
 i = change_plot_chr@(0,"y_axis",0,"'Sin(x)'")
but the axis label becomes 'Sin(x)' instead of Sin(x)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Apr 21, 2025 7:12 am    Post subject: Reply with quote

Ken

Thank you for the feedback. I have made a note that this needs investigating.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 22, 2025 8:48 am    Post subject: Reply with quote

This failure has now been fixed for the next release of the ClearWin+ library.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 801
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Wed Apr 23, 2025 2:21 pm    Post subject: Reply with quote

Thank you Paul, it has taken me years to isolate this failure!
Back to top
View user's profile Send private message
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