Did i forget to declare something in this code where i tried to get RGB value at mouse pointer? My code has millions of Clearwin commands, but every time i try to add something new my previous experience does not matter at all. Like many of us (remember, Eddie?) slowly i start swearing and then yelling. Crashes and access violations is the only way Fortran exposes its errors. Added some Clearwin option - crash. Removed - crash, tried this - crash, tried that - crash, oh, may be this is the reason - crash, or that - crash. How it worked before? Taking older code - also crash? Impossible! Looked at HELP, added one more option - still crash, crash, crash.
use clrwin
integer, external :: SnapshotPL, mouse_RGB2
parameter (N=6)
real*8 X(N), Y(N)
Data X/1., 1e1, 1e2, 1e3, 1e4, 1e5/
Data Y/0.01, 10.2, 1266, 8333, 2111, 77/
i=winio@('%ww%pv%^pl[file=DDrates.set,title='D-D fusion',x_axis='Energy (keV)', &
& y_axis='Fusion crs',x_array,scale=log_log,n_graphs=1,y_min=1.e-2,y_max=1.e4, &
&full_mouse_input]&', 480,360, n, X, Y, mouse_RGB2)
i=winio@('%ff%cn%^tt[Snapshot]%es', SnapshotPL)
end
!----------------------------------------------
! __ ___ ___ ________
! / |/ /__ __ ________ / _ \/ ___/ _ )
! / /|_/ / _ \/ // (_-< -_) / , _/ (_ / _ |
!/_/ /_/\___/\_,_/___|__/__/_/|_|\___/____/
! /___/
!------------------------------------------
integer*4 function mouse_RGB2()
use clrwin
ix_mouse = clearwin_info@('graphics_mouse_x')
iy_mouse = clearwin_info@('graphics_mouse_y')
iflag_mouse = clearwin_info@('graphics_mouse_flags')
! call get_mouse_info@(ix_mouse, iy_mouse, iflag_mouse)
call GET_RGB_VALUE@( ix_mouse, iy_mouse, iRGBvalue )
ir256 = and (iRGBvalue,255)
ig256 = and (rs(iRGBvalue,8),255)
ib256 = rs (iRGBvalue,16)
print*,'ir256 ...', ir256, ig256, ib256
mouse_RGB2 = 2
end function
!......................................................
! ____ __ _ __ ____ ____ _ _ __ ____
! / ___)( ( \ / _\ ( _ \/ ___)/ )( \ / \ (_ _)
! \___ \/ // \ ) __/\___ \) __ (( O ) )(
! (____/\_)__)\_/\_/(__) (____/\_)(_/ \__/ (__)
!......................................................
! http://patorjk.com/software/taag/#p=display&h=2&v=0&f=Doh&t=Snapshot
integer function SnapshotPL ()
use clrwin
character PNGfilename*256, chdate*8, chtime*10, chzone*5
integer ivalues(8)
call DATE_AND_TIME(chdate, chtime, chzone, ivalues ) ! chdate format 20210504
PNGfilename = 'zDesignerPL_'//chdate(1:8)//'_'//chtime(1:6)//'.png'
i = export_image@(trim(PNGfilename))
call sound@(3000,1)
call sound@(1000,1)
call sound@(2000,1)
SnapshotPL = 2
end function