

                                       Table Of Contents


1.0  INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . .   2

2.0  STANDARD GET CLAUSES. . . . . . . . . . . . . . . . . . . . . . . .   5
       2.1    SHOW MESSAGE . . . . . . . . . . . . . . . . . . . . . . .   5
              2.1.1   SETMYX() . . . . . . . . . . . . . . . . . . . . .   7
       2.2    SETGETDEL(). . . . . . . . . . . . . . . . . . . . . . . .   8
       2.3    CHECK KEY. . . . . . . . . . . . . . . . . . . . . . . . .   9

3.0  GET FROM LIST . . . . . . . . . . . . . . . . . . . . . . . . . . .  10
       3.1    SETDELIMS. . . . . . . . . . . . . . . . . . . . . . . . .  13

4.0  GET FROM DBF. . . . . . . . . . . . . . . . . . . . . . . . . . . .  14

5.0  GET AS PROPER . . . . . . . . . . . . . . . . . . . . . . . . . . .  15

6.0  GET AS PASSWORD . . . . . . . . . . . . . . . . . . . . . . . . . .  16

7.0  GET AS TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . .  17

8.0  GET DECINC. . . . . . . . . . . . . . . . . . . . . . . . . . . . .  19
       8.1    SETIDKEYS. . . . . . . . . . . . . . . . . . . . . . . . .  20

9.0  GET LOCK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  21



                                            Page 2


                                       1.0  INTRODUCTION




The SCBGET lib provides a number of get enhancements. SCBGET does not
replace your existing GETSYS program, so there should not be any conflicts if
extensions have been added to it.

The following GET extensions have been added:

*      Get from list of values. Entry of values from an array based on partial
       entering of value.

*      Get from database. Enters values from a database based on partial
       entry of value.

*      Proper data entry. Converts first character of every word to upper case
       while entering data

*      Get as time. Get validation of time. Prevents invalid time string from
       being entered. Can be entered as 24hr format or AMPM format.

*      Get as password. Prevents actual information from being displayed.
       Displays characters as user specified character.

*      Lock current field.

*      Display message with GET.

*      Assign a specific key to a GET.

*      Display delimiters around current GET.



                                            Page 3


The SCBGET library is copyright of the author, Stein Borge, 1995 and is
released as Shareware.  Program authors may incorporate it freely into their
applications for testing and inspection.

You may use SCBGET.LIB free for a 30 day evaluation period.  SCBGET.LIB is
Shareware, which means each user must register his or her copy for use beyond
the evaluation period.  Use of non-registered copies of SCBGET.LIB is
prohibited.

If it is used beyond the 30 day evaluation period a once only contribution of
$US  25 or $CDN 30 or UK 20 is requested. Upon receipt of payment copies of
the source code will be made available. Canadian dollars is preferable.

Since I currently don't have a permanent fixed address, please E-Mail me at
my Compuserve account 76720,3454 for current address information, or any
queries or questions you may have about the library.

If your sending mail from the Internet address it to 76720,3454@compuserve.com

You are encouraged to make copies of SCBGET.LIB to give to your friends
or to upload to your favourite BBS.  These copies should be the original
SCBGET.ZIP file.

This library has been a great help to me and I hope that it will be to you,
too.  A great deal of time has gone into this library, and I am constantly
trying to improve it. Please feel free to send comments on enhancements you
would like to see in the library, or to report on any bugs or questions
you may have about the library.

And finally, the legal bit...

Disclaimer

The user of this library takes full responsibility for any loss or damaged data
that might occur as a result of using this library.  I have made every attempt
to ensure that this library will respond as described. Stein Borge will take no
responsibility if an error occurs and data is lost or data becomes damaged and
the cause has been found to be the functions operations.


Stein Borge



                                            Page 4


Technical Notes

The SCBGET library uses only standard Clipper code. No use is made of third
party libraries or internals.

SCBGET GET extensions are compatible with Clipper's standard @ GET statement.
You can still use PICTURE, VALID, WHEN, etc. with any of the new get clauses.
The only clause that is not supported is the RANGE clause, which can be
simulated using a VALID clause.

SCBGET extensions use a custom reader for each GET. There should not be any
conflicts if you are using another custom GET reader since it is only invoked
for the extensions in this library.

Demo Program 

There is a demo program called GETDEMO.PRG which contains examples on all of
the SCBGET GET enhancements. This can be by compiled by either using the
MKDEMO50.BAT or MKDEMO52.BAT batch files. The MKDEMO50 compiles and links
the demo with SCBGET50.LIB which is compiled using Clipper 5.01. I have not
tried compiling using Clipper 5.0 together with this library.

The MKDEMO52 compiles and links the demo with SCBGET52.LIB which is compiled
using Clipper 5.2c. This should be compatible with all 5.2x versions.






                                            Page 5


                                   2.0  STANDARD GET CLAUSES


The SCBGET LIB adds a number of additional GET clauses. For each of the new GET
clauses there are standard GET clauses. The standard get clauses include
PICTURE, WHEN and VALID, plus a number of additions. The additions are as
follows:

@ <row>, <col> [SAY <sayxpr>] GET <var> [NEW GET CLAUSE...];
                                    [PICTURE <picture>];
                                    [WHEN <when>];
                                    [VALID <valid>];
                                    [SHOW MESSAGE <cMessage>[,<nXp>,<nYp>]];
                                    [CHECK KEY <xKey>,<bKey>];
                                    [SEND <msg>];
                                    [COLOR <color>]


2.1    SHOW MESSAGE

Description

Show message displays a message for the current GET. The message can either be
displayed at default location on screen or at user specified location. The
default location is the last row, centred. The default location can be
changed (see the setmyx() function)

Syntax

SHOW MESSAGE <cMessage> [,<nYp>,<nXp>]

Arguments

cMessage      Message to be displayed.

nYp           Optional. Specific row to display message.

nXp           Optional. Specific column to display message.




                                            Page 6


Examples

The following example would display a message at the default location,
prompting a user to enter a value less than five

a:=1
@1,1 say "Enter Number " get a picture "9999";
                                   valid a>5 ;
                                   show message "Enter a number less than five"
read



The following example would display a message starting at row 0, column 10,
prompting a user to enter a value less than five:

@1,1 say "Enter Number " get a picture "9999";
                            valid a>5;
                            show message "Enter a number less than five",0,10
read


2.1.1         SETMYX()

Description

Changes the default row and column coordinates for the MESSAGE clause.

Syntax

setmyx(nY,nX)

Arguments

nY            Row to display message. This can be a value between 0 and 24.

nX            Column to display message. This can be a value between -1 and 79.
              If value is -1, message will be centred on row.




                                            Page 7


Returns

Returns current message row/column to a two dimensional array.

Example

/* The following would set the default row and column coordinates to row 0
and centre the message on the row. It returns the current settings to the
array aCurrXY*/

aCurrYX:=setmyx(0,-1)



                                            Page 8


2.2    SETGETDEL()


Description

Changes the GET delimiter. These delimiters will only be displayed beside the
current GET variable. SETGETDEL functions as a on/off switch for GET
delimiters. If SETGETDEL("","") is called the delimiters are turned off. These
delimiters will only be displayed beside GET's that contain SCBGET extensions.

Syntax

setgetdel(cLd,cRd)

Arguments

cLd           Single character to appear on the right of the GET. 

cRd           Single character to appear on the left of the GET. 


Returns

Returns current get left/right delimiter to a two dimensional array.

Example

/* The following would set the right delimiter as a "[" and the left
delimiter as a "]" and return the current delimiter settings in the array
aCurrDel. */

aCurrDel:=setgetdel("[","]")




                                            Page 9


2.3    CHECK KEY

Description

CHECK KEY assigns a function to a keystroke for the specified GET. This is
useful when you want to assign specific keys only to certain GET's.

The following example would display a message prompting the user to enter
a date. Pressing F2 would enter todays date only for the that field.

dDate:=ctod("  /  /  ")

@1,1 say "Enter Date " get dDate ;
                         show message "Enter a date. F2 to enter todays date";
                         check key K_F2,tdate()

read

* Puts todays date in current field

function tdate
 local oG:=getactive()
 oG:varput(date())
return NIL 


                                            Page 10


                                      3.0  GET FROM LIST


Description

Get from list of values. Entry of values from an array based on partial
entering of value, ie. if you enter Fre it would enter Fred Smith. Get from
list can also enter value based on a reference value, ie. if you enter NY
it could enter New York.

To use the FROM LIST clause you must define either a 1 or 2 dimensional
array. The 1 dimensional array is if you want to enter values based on partial
entry of the value, while the 2 dimensional array is if you want to use a
reference value.

e.g:

The following one dimensional array would be used for partial data entry, ie.
if you entered BL it would fill in BLUE

aL:={"RED","BLUE","ORANGE","BROWN","GREEN"}

The following two dimensional array would be used for data entry using a
reference value, ie. if you entered FS it would fill in Fred Smith

aL2:={{"FS","Fred Smith"},{"SJ","Sally Jones"},{"JB","Joe Bloggs"},
      {"LH","Lisa Hanson"}}

There is no limit to the number of values you can have in the array except
for the internal 4096 element limit.

You can enter multiple values using the GET FROM LIST clause. For example,
if you are filling in a field that requires one or more recipients to be
entered, you could use GET FROM LIST to enter only their initials and it
would fill in the full name.





                                            Page 11


Example

Entering  FS, then SJ, then JB, would enter Fred Smith,Sally Jones,Joe Bloggs.

If you decide you want to replace one of the values with a different one, move
to the first character of the value you want to replace and type the new value.
If the new partial valure/reference value is in the array, the current value
will automatically be replaced with the new  one.

Example:

If you have a field containing the values Fred Smith,Sally Jones,Joe Bloggs
and you want to replace Sally Jones with Lisa Hanson, move to the first
character of Sally and enter LH. You should now see Fred Smith,Lisa Hanson,
Joe Bloggs

The way values are replaced is controlled by delimiters. In the above example,
the delimiter is the comma. The number and type of delimiters can be changed
at any time.

If you wanted to be able to enter multiple colors but have a choice between
using the space or comma as delimiters, you would specify the space and comma
as the delimiters. The default delimiters are the space and comma.

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    FROM LIST <aList>,<nBegin>,[<cDelimiter>];
                                    [<Standard GET clauses.....>]

Alist:        A one or two dimensional array containing values to enter into
              field.

nBegin        Starting value. This value is the minimum number of characters
              that will be read before value will be searched.

e.g If array aList contains a list of colors BLACK,BLUE and RED, nBegin would
have to be passed as 3, since both BLACK and BLUE both start with BL and would
require at least 3 character for positive match.

cDelimiter    Delimiter for entering multiple values. The system default is the
              space and comma, but you can change it for the specific get.




                                            Page 12


Examples

This example enters information from the aL2 array  based on the first 2
characters. Since the array is 2 dimensional, it inserts the second element
into the field. It uses the as a delimiter when entering multiple values.

aL2:={{"FS","Fred Smith"},{"SJ","Sally Jones"},{"JB","Joe Bloggs"},;
      {"LH","Lisa  Hanson"}}

e:=space(60)

@1,1 say "Enter Recipients:" get e from list aL2,2,"," 
read


This example enters information from the array aL based on the first 2
characters entered:
 
aL:={"RED","BLUE","ORANGE","BROWN","GREEN"}
d:=space(60)

@1,1 say "Enter colors:" get d from list aL,2 
read



                                            Page 13


3.1    SETDELIMS

Description

Sets the default delimiters used by GET FROM LIST and GET FROM DBF. The default
delimiters are the space character and comma.

Syntax

setdelims(cDels)

Arguments

cDels         Character string containing possible delimiters for GET FROM DBF
              and GET FROM LIST.

Returns

Returns current delimiter as a character string.

Examples

/* This would assign the current delimiters to cCurrDelim and set new
delimiters as / and , */

cCurrDelim:=setdelims("/,")


                                            Page 14


                                       4.0  GET FROM DBF

Description

Get from database. Enters values from a database based on partial entry of a
value in a field. Databases and indexes must be opened before using this
clause.

Aguments

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                      FROM DBF <dbf>, <order>, <nSt>,<field>[,<cDelim>] ;
                                    [<Standard GET clauses.....>]


dbf           Database to retrieve values from. Database must be open.

order         Index order. This is the order you wish to search on. The index
              you want to search on should indexed using the upper() function
              , or every field for the reference value should be entered upper
               case, since when the value is SEEKED it actually seeks for the
              value you have entered converted to upper case. This makes
              entering of the reference value not case sensitive.

nSt           Starting value. This value is the minimum number of characters
              that will be read before value will be searched.

e.g If the database dbf contained a list of colors BLACK,BLUE and RED, nSt
would have to be passed as 3, since both BLACK and BLUE both start with BL and
would require at least 3 character for a positive match.


Field         Name of field to insert into current get upon match.

cDelim        Delimiter for entering multiple values. The system default is the
              space and comma, but you can change it for the specific get.



Examples


This example enters information from the COUNTRY database based on the first  2
characters. It uses index order 1. It inserts the field COUNTRY and uses ',' as
the delimiter.

use country index code

g:=space(60)
@1,1 say "Enter Name " get g from dbf "country",1,2,"country",","  
read





                                            Page 15


                                      5.0  GET AS PROPER


Description

Proper data entry. Converts first character of every word to upper case while
entering data.

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    AS PROPER;
                                    [<Standard GET clauses.....>]

Arguments

No additional arguments.


Example

The following example uses the AS PROPER clause to enter information into the
field with the first character of each word upper case.

b:=space(50)
@1, 1 say "Enter name " get b as proper
read


                                            Page 16


                                     6.0  GET AS PASSWORD


Description

Gets value as password. Prevents actual information from being displayed.
Displays characters as user specified character. The default password character
is the asterix, "*".

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    AS PASSWORD [DISPLAY <cDc>];
                                    [<Standard GET clauses.....>]


Arguments

cDc           cDc is an optional character argument which specifies what
              character to be displayed for characters within field. The
              default character is the asterix "*".


Example

The following example uses the AS PASSWORD clause to enter the value displaying
 '' (ASCII character 254) for each character entered.

 a:=space(40)
 @1, 1 say "Enter Password " get a as password display chr(254)
read



                                            Page 17


                                       7.0  GET AS TIME

Description

Get validation of time. Prevents invalid time string from being entered. Can
be entered as 24hr format or AMPM format.

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    AS TIME [<neditf>] [,<ndispf>];
                                    [<Standard GET clauses.....>]

Arguments

nEditf        Optional edit format. Controls how the time format can be
              entered. If omitted time can be entered in 24 or AM/PM format.

ndispf        Optional display format. Controls how the time format is stored
              and displayed. If omitted time can be entered in 24 or AM/PM
              format.

The nEditf and nDispf arguments are defined as constants in SCBGET.CH

HR24=1
AMPM=2

Examples

This example allows you to enter date in any format but stores and displays it
in 24 hour format. It assigns the F2 to the function cTime(), which enters
current time.

#include "scbget.ch"
#include "inkey.ch"

f:=space(6)
@1,1 say "Enter time " get f as time ,HR24 ;
                         show message "Enter time",20,10;
                         check key K_F2,ctime() ;
                         color "B/W+"
read


                                            Page 18


This example allows you to enter date in 24 hour format only:

#include "scbget.ch"
#include "inkey.ch"

    f1:=space(6)
  @1,1 say "Enter time " get f1 as time HR24 

  read


This example allows you to enter date in 12 hour format but stores and stores
it in 24 hour format :

#include "scbget.ch"

  f2:=space(6)
  @1,1 say "Enter time " get f2 as time AMPM,HR24
  read


This example allows you to enter date in 24 hour format but stores and stores
it in 12 hour format. It assigns the F2 to the function cTime(), which enters
current time.

#include "scbget.ch"
#include "inkey.ch"

  f3:=space(6)
  @1,1 say "Enter time " get f3 as time HR24,AMPM ;
                                     check key K_F2,ctime()
  read


*Enters current time into current active field.

function ctime
local boGet:=getactive()
 boGet:VarPut(left(time(),5))
return(.T.)


                                            Page 19


                                        8.0  GET DECINC

Description

The DECINC clause allows a user to decrease and increase a value using a
predefined set of keystrokes. DECINC will work on either a numeric or date
field. DECINC also works with arrays, which allows a user to toggle through a
list of values. The default keys are the '+' and '-' key. These keys can be
changed using the setidkeys() function. You can use the space bar to toggle
through a list of values if you are passing an array.

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    DECINC [BY] [USING] [xList];
                                    [<Standard GET clauses.....>]

Arguments

xList  xList can either be a numeric value or an array of values. If it's a
       numeric value, DECINC will use this value to increase/decrease the field.
       If it's an array of values DECINC will toggle through the list of values.



Examples

The following example uses the DECINC clause to increase/decrease the numeric
value being entered by 2. Use the '+' and '-' key to change value.

num:=0
@1, 1 say "Enter number " get num decinc by 2 picture "9999"
read

The following example uses the DECINC clause to increase/decrease the date
value being entered by 30 days. Use the '+' and '-' key to change value.

dDate:=date()
@9, 1 say "Enter date " get dDate decinc by 30;
                      show message "Use + and - keys to change date by 30 days"
read


                                            Page 20


The following example uses the DECINC clause to skip through a list  of values
found in the aL array. Use the '+' and '-' key to change value,or press the
space key to increment one value at a time.

aLs:=space(10)
aL:={"RED","BLUE","ORANGE","BROWN","GREEN"}

@14, 1 say "Enter color " get aLs decinc using aL ;
                      show message "Use '+' and '-' keys to change value"
read


8.1    SETIDKEYS

Description

Changes the keys used to increase and decrease the values.

Syntax

setidkeys(cUp,cDown)


Arguments

cUp           Single character used to increase value.

cDown         Single character used to decrease value.

If using alphabetical characters pass the parameters as uppercase.

Returns

Returns current decrease/increase keys in a 2 dimensional array.

Example

aCurr:=setidkeys("Q","A")



                                            Page 21


                                         9.0  GET LOCK



Description

Lock allows a user to move into a field but prevents them from entering data. 

Syntax

@ <row>, <col> [SAY <sayxpr>] GET <var>;
                                    LOCK;
                                    [<Standard GET clauses.....>]

Arguments

No arguments required.

Example

The following example uses the LOCK clause to prevent information from being
entered into the field.

aLs:=space(10)

@1, 1 say "Enter color " get aLs lock
read
