The CodeShop

Clipper

How to make a Clipper Screensaver

The kind of thing you need to do is as follows:

Make a copy of \clipper5\include\std.ch as mystd.ch

Edit mystd.ch and add the line:

    #translate inkey(0) => scrsaver()
Create a scrsaver() function that does whatever it should, but exits on INKEY().
e.g.
FUNCTION scrsaver
    LOCAL oldscr:=SAVESCREEN(0,0,24,79),i:=0,key:=0
    CLEAR
    DO WHILE key=0
        @ 0,i SAY CHR(0)
        key:=INKEY(1)
        @ 0,i SAY " "
        IF ++i>79
            i:=0
        ENDIF
    ENDDO
RETURN key
Compile this as normal.

Re-compile all your source code with a /umystd.ch switch

Compile getsys.prg with a /umystd.ch switch and explicitly link it into your application.

This will catch all uses of INKEY(0), including the GET system. If you want to trap the MENU TO system, then you will need to write a replacement system and add it into mystd.ch as

#command SET MESSAGE TO         => ss_setmess()

#command SET MESSAGE TO            => ss_setmess(0)

#command @ ,  PROMPT  [MESSAGE ]                 ;
                                 => ss_prompt(,,,)

#command MENU TO                => :=ss_menu()
where ss_setmess(), ss_prompt() and ss_menu() are your new functions.

Click here for my versions of these three functions. You are free to use these, provided you leave my copyright header in the code. Of course, you may need to comment out some bits that require the rest of my library to work, but that's part of the joy of using someone else's code, isn't it?

C++ (Usually MFC)

No code so far, but I've a screensaver you may like. It's written for Win 3.1, but does work with W95. It's called the Physicist's Desk because You need the .scr and .ini files in your Windows directory. You set up the .ini with the text and .bmp files you want to display and that's it.

Have fun.

Frequently Asked Questions

Not a full list, but a gradually-incresing set of questions I've answered, normally on UseNet.

Why does my Access MBD keep on growing?

Access (in common with other RDBMs) doesn't do garbage collection unless told to (via it's "Compact & Repair" option). So each deleted record is still hogging space.

If you're going to do a lot of adding & deleting, then you can add an extra field to your table which indicates whether the record is "alive" or "dead". Then, instead of deleting, you set the flag to "dead". When adding, you find a "dead" record & overwrite it. If there isn't a "dead" record, then add a new one.
Back to the home page