Silverfrost Forums

Welcome to our forums

Return from %mn callback not working

18 Jun 2021 2:45 #27966

Something changed after 8.71 (scc_lib version=18664).

Previously, when a %mn callback is processed, the return value can be used to terminate the parent window. The following code illustrates this. Clicking on the %mn causes the callback function to execute and begin counting down the value that is also returned through the callback. Once it reaches 0, I decrement it yet again to make sure it is -1 or less. When this happens, the parent window does not close, as it should. When the window is manualy closed, the last value returned from the callback function is returned (as the absolute value), and displayed.

This code was compiled using all the latest DLL's, compiler, etc.

	winapp
	program main
        integer,external:: run1
	integer:: ret_val
        common/dataishere/ret_val
        data ret_val/5/	
         i=winio@('%mn[Change]&',run1)
	 i=winio@('%`rd', ret_val)
         print *,i
	
	end
        integer function run1()
        use mswin
	integer:: ret_val
        common/dataishere/ret_val
        ret_val = ret_val - 1
        if(ret_val.eq.0)ret_val = ret_val - 1
        call window_update@(ret_val)
        run1 = ret_val
        return
        end
18 Jun 2021 5:23 #27967

Thanks Bill.

This has been fixed and a new set of DLLs has been uploaded.

19 Jun 2021 2:37 #27970

Thanks, Paul! All working now!

Please login to reply.