Dec 102017
 
On Screen Ruler in Clipper. Useful for screen design.
File RULER.ZIP from The Programmer’s Corner in
Category Dbase Source Code
On Screen Ruler in Clipper. Useful for screen design.
File Name File Size Zip Size Zip Type
YC_RULER.DOC 3280 1464 deflated
YC_RULER.PRG 9006 3077 deflated

Download File RULER.ZIP Here

Contents of the YC_RULER.DOC file


===============================================================================
YC_RULER.DOC Yellick Computing Dec '87
===============================================================================

YC_RULER is one of those head-banging "why didn't I think of that" utility
procedures. It's main function is to help you quickly determine cursor
locations on screen. You assign the procedure to a "hot-key" by way of the
SET KEY TO command. Whenever your Clipper program is in a wait state (for
example, during a READ) you can hit the hot-key and get instant access to
row/column information.

I wrote this procedure for use in my software development company (Yellick
Computing, which explains the YC_ prefix). We found ourselves smudging up
our monitor screens trying to count characters and devising special pieces
of paper with mysterious markings to measure long distances. Why not let
the expensive heap of desktop hardware do the thinking? So I wrote a crude
version of this ruler utility. But why stop there?

How many times have you compiled and linked trying to get a box to fit just
right? Or sat chanting "1 2 3 4" as you counted out the space between the
last word on line 3 and the first word on line 22? After using the on-screen
ruler for a while I added an "offset" ruler which makes coding relative co-
ordinates almost effortless.

Like most obsessive hackers I went overboard and added numerous features of
questionable value, all in the name of the perfect utility. The thing grew
from a dozen un-commented lines of terse Clipper code into a monstrous 250+
lines of pretty source and chatty comments. Once compiled, however, it
adds very little to your program. Most of the bulk is comment lines.

The top 50 lines of the source code file have all the instructions you will
need to make quick use of this utility. Briefly, here's how to implement
the ruler.

Near the top of your initial procedure add the line-

SET KEY nnn TO Ruler && On-screen ruler, assigned to the ??? key

where nnn is the INKEY() value of the hot-key you want to use to call the
utility. In my applications, the line looks like this-

SET KEY -20 TO Ruler && On-screen ruler, assigned to the Ctrl-F1 key

You can assign the ruler to just about any key on the keyboard. Novice
Clipper users, you should use this-

SET KEY 13 TO Ruler && Heh heh heh.

Add YC_RULER to your linking information, and make sure the file YC_RULER.OBJ
is available for the linker to chew on. I have named the file YC_RULER rather
than RULER so the file will compile on it's own. I know this is confusing but
that's the way Clipper likes it. The comiler and linker think of this utility
as YC_RULER, but once inside your application you must reference it as RULER.

Questions or comments? Contact Craig Yellick on the Source @ BEB817, or
see the header in YC_RULER.PRG for address/phone information.

YC_RULER has been flushed into the public domain. Do with it what you will.

===============================================================================
END YC_RULER.DOC
===============================================================================


 December 10, 2017  Add comments

Leave a Reply