FSCROLL - A sort-of browse replacement for FoxPro 2.5+ for Windows

(C) 1994 Jason Landry
All Rights Reserved

I can be reached on CompuServe at 74473,3256.

You are granted a license to use this program for personal use.  This
product may not be used in an application with an intended user base that
exceeds one hundred users.  For pricing in such situations, contact the
author via CompuServe.

Introduction

FSCROLL is a driver for GENSCRNX version 2.0 and higher by Ken Levy.

FSCROLL is short for Field Scroll.  It's hard to explain without looking
at an example, so look from foxpro, type DO EXAMP1 to get an idea of what
this program does.  To the left, a standard list of people is presented.
To the right, within the rectangle, are fields that represent data within
the highlighted record.  Normally, to display more than a dozen or so
fields, you need more screens.  But try tabbing to the bottom of the
fields listed...the fields scroll up and down.  

This program is easy to implement from a programming standpoint.  The most
difficult part is the setup snippet for the screen.  In this snippet, add
the line 

*:SCXDRV5 FS

You will also need to create an array that contains the information you are
to collect in the scrolling fields.  I have attempted to make FSCROLL more
than just a field scroller, but a system that can dynamically change to
your data.  For this reason, the array is probably bigger than it needs to
be, but it was the only way to include all the snippets available through
the screen builder.  In any case, let's say you have 15 fields you wish to
put into the scroll:

DIMENSION sample(15,5)

each of the array ROWS must have the following columns, in this order:

sample(1,1)="First Name"				- The prompt for the field
sample(1,2)="David"						- The value for the field (editable)
sample(1,3)="'Enter the first name'"	- A text expression for the MESSAGE
									 	  note that this can also be a function
sample(1,4)="MyFunc(1)"					- A WHEN procedure/function
sample(1,5)="YourFunc('Testing')"		- A VALID procedure/function

That's it.  Again, this system is intended to be data-driven.  Rather
than manually coding everything, the sample program contains a TEXT.DBF
file that is read into the array with a SELECT-SQL clause in the screen
setup snippet.  Not only does this make the programming easier to understand,
but (GASP!) you'll be able to let your users change the prompts, and 
messages displayed without recompiling.

Within each expression, {{n}} is a shorthand way of using your array
as a character expression.  For example, if you wanted the above example
to also prompt for the last name, you might try:

sample(2,3)=[ "Enter "+{{1}}+"'s last name"

If this particular name was "David", the message would appear as

Enter David's last name

in the message area.


Once you've created your area (again, PLEASE look at the sample code.), the
rest is quite simple.  All you need to do is draw a rectangle, and add one
single directive:

*:FS sample

That's it!  FSCROLL will automatically figure out how many fields can fit
in the area you've drawn.  LOOK AT THE EXAMPLE.  PLAY WITH IT.  LET IT
BE YOUR FRIEND.  Re-size the rectangle and recompile.  Look at the directives
and play with them.  

You can draw as many different rectangles on the screen, with as many
different array names as you like.  I've had four working rather nicely.
It will work fine.

One final note:  This program does its work by shifting the values contained
in the array (READ: smoke and mirrors).  In other words, just because you
set up sample(2,2) to be "Johnson," at any given time, it *will not* be
guaranteed to be the case.  However, the program also has the intelligence
to search for any array reference to "sample" and automatically adjust
the referenced value.  For example, you might have in your code

sample(1,2)="Steve"

FSCROLL will automatically convert this to something ugly (with lots of
MOD arithmetic) to always return the correct value.  This, however, does
NOT work in named expressions.  So if you find the wrong fields getting 
updated, make sure you are explicitly referencing arrays.  This is much
more confusing than it seems.  Ignore it for now.

Study the sample and fs.prg for more information.  

The following directives are currently supported:

SETUP SNIPPET
-------------
*:SCXDRV5 FS		<-- place BEFORE 3D

RECTANGE
--------
								 default	description
*:FS <array>								Array name containing the data
*:FSFONT face,size				 Arial,8
*:FSBOLD <[SAYS|GETS|NONE|BOTH]> SAYS
*:FSRATIO <ratio>				 .35		Ration of SAY space to GET space


The below are margins.  They are all in pixels.  The defaults vary, depending
on the font.  Look at FS.PRG for details
*:FSLM - left
*:FSRM - right
*:FSTM - top
*:FSBM - bottom
*:FSFM - field (vertical, between gets)
*:FSGM - get (horizontal, between says & gets)


