Silverfrost Logo About Us | Contact Us

Screen saver - %sv

By using %sv it is possible to create a screen saver. A format window that includes %sv will close as soon as it receives mouse or keyboard input. The executable should be renamed to a <filename>.SCR file, placed in the Windows directory and then selected as the current screen saver from the Control Panel. Apart from its obvious use, a screen saver can be used to perform a lengthy calculation. To ensure the calculation is continued from where it was interrupted, the %cc (window closure format) should be used to trap the closure and perform file I/O.

For example:

        INCLUDE <windows.ins>
        INTEGER xres,yres,g_handle,r,g,b,i
        COMMON  xres,yres,g_handle,r,g,b
        EXTERNAL redraw_screen
        DOUBLE PRECISION secds
c ---   %bg background colour
c ---   Define a window that takes the Whole display area
     +   // 'no_frame,no_border,topmost]&')
c ---   Use a periodic delayed callback to initiate updates
c ---------------------------------------------------------
        INTEGER FUNCTION redraw_screen()
        INCLUDE <windows.ins>
        INTEGER xres,yres,g_handle,r,g,b,loop
        COMMON  xres,yres,g_handle,r,g,b
        CALL select_graphics_object@(g_handle)
        DO loop=1,yres
          CALL draw_line_between@(0,loop,xres,loop,RGB@(r,g,b))
          IF(r.GT.255) r=0
          IF(g.GT.255) g=g-255
          IF(b.GT.255) b=b-255



Copyright © 1999-2017 Silverfrost Limited