Dec 102017
 
SANDY - A collection of array, memory variable, and windowing functions for Clipper.
File JBV1_2.ZIP from The Programmer’s Corner in
Category Dbase Source Code
SANDY – A collection of array, memory variable, and windowing functions for Clipper.
File Name File Size Zip Size Zip Type
ARRAYS.OBJ 2147 987 deflated
ARRAYS.PRG 4046 932 deflated
AUTO.OBJ 2942 1416 deflated
AUTO.PRG 5422 1413 deflated
POPUPS.OBJ 1135 662 deflated
POPUPS.PRG 524 258 deflated
QUEST.OBJ 1210 748 deflated
QUEST.PRG 1179 523 deflated
SANDY.DOC 13134 3213 deflated
SANDY.LIB 14848 5088 deflated
WINDOWS.OBJ 6000 2455 deflated
WINDOWS.PRG 11278 2435 deflated

Download File JBV1_2.ZIP Here

Contents of the SANDY.DOC file


* Title..: Documentation of SANDY.LIB
* Author.: Joseph D. Booth
* Version: 1.2
*
* The following documentation describes the array, memory variable, and
* windowing functions contained in SANDY.LIB. Each program is written as
* a series of user-defined functions. To include the functions within your
* program, you must include the SANDY.LIB file in your LINK command.
*
* Examples:
*
* a) using PLINK - PLINK86 FI yourprog LIB CLIPPER,EXTEND,SANDY
*
* b) using TLINK - TLINK youprog,yourprog,yourmap,CLIPPER EXTEND SANDY
*
* This library is released into the public domain and may be used freely.
*
* I will answer questions about the program if you need help. I can be
* reached at (215) 953-1202 during 8-5 EST.
*
* This library was created using BORLAND's TLIB program. All code in the
* library is written in CLIPPER. If the library does not function properly
* the object modules and source code is included in this ARCHIVE.
*
* Version History: 1.0 First release
*

* 1.1 Added optional colors to the windows
* Fixed bug in W_INIT, which was always
* returning .F.
*
* 1.2 Add new commands W_PRINT and W_VIEW to the
* windowing functions. Also added several new
* functions
*
* SQZD() - Compress a date to 3 characters
* UNSQZD() - Uncompress a date
* SQZN() - Compress a number in half
* UNSQZN() - Uncompress a number
* POP_SAVE() - Save environment in POP-UP's
* POP_REST() - Restore saved environment
* YOU_SURE - Windowed YES/NO question
*
* Although I don't want any financial contribution for this library, I would
* appreciate if you use it to either call or write me and let me know what
* BBS you got it from. I want to be sure that updated versions of the
* library get placed on all the BBS's.
******************************************************************************

ARRAYS() - Numeric array functions

* These functions work on numeric arrays only. No type checking is done of
* the array.

aavg( , ) - average of array
adec( @,, ) - fill array with decreasing numbers
ainc( @,, ) - fill array with increasing numbers
amax( ) - return highest numeric value
amin( ) - return lowest numeric value
atot( ) - total of array

* ---------------------------------------------------------------------------

FUNCTION aavg
* Purpose: What is the average value in the array
* Returns: The numeric average
* Syntax.: aavg( [,] ) - Where expC is the array name and
* - expL means include zero's in calculation
* ---------------------------------------------------------------------------

FUNCTION adec
* Purpose: Fill an array with decreasing numbers
* Returns: Filled array
* Syntax.: adec( @[,,] ) - where expC is array name
* expN1 is starting value
* expN2 is decrement
* ---------------------------------------------------------------------------

FUNCTION ainc
* Purpose: Fill an array with increasing numbers
* Returns: Filled array
* Syntax.: adec( @[,,] ) - where expC is array name
* expN1 is starting value
* expN2 is increment
* ---------------------------------------------------------------------------

FUNCTION amax
* Purpose: What is the highest number in an array
* Returns: The value of the maximum element
* Syntax.: amax( ) - Where expC is the array name
* ---------------------------------------------------------------------------

FUNCTION amin
* Purpose: What is the lowest number in an array
* Returns: The value of the minimum element
* Syntax.: amax( ) - Where expC is the array name
* ---------------------------------------------------------------------------

FUNCTION atot
* Purpose: What is the total value of the array
* Returns: The total value of the array
* Syntax.: aavg( ) - Where expC is the array name
* ---------------------------------------------------------------------------


AUTO() - Database memory variable creation, also reducing DB storage

automem( ,, ) - Create memory variables
autorep( , ) - REPLACE database fields with
memory variables
sqzd( ) - Compress a date to 3 chars
sqzn( , ) - Compress a number in half
unsqzd( ) - Uncompress a date
unsqzn( ) - Uncompress a number


FUNCTION automem
* Purpose: To create one memory variable for each field in a work area
* Returns: - .T. if created ok, .F. otherwise
* Syntax.: automem( ,, )
*
* - Where expC1 is the memory variable prefix, (i.e. "M_" )
* expC2 is the work area ALIAS
* expL is .T. to create blank fields
* .F. to initialize variables with database fields
* ---------------------------------------------------------------------------

FUNCTION autorep
* Purpose: To REPLACE work area fields WITH memory variables
* Returns: - .T. if REPLaced ok, .F. otherwise
* Syntax.: autorep( , )
*
* - Where expC1 is the memory variable prefix, (i.e. "M_" )
* expC2 is the work area ALIAS
* ---------------------------------------------------------------------------

FUNCTION sqzn
*
* Syntax.: SQZN( , )
* Where..:
* the numeric memory variable
*
* the size of the number
*
*
* Returns: the squished string representation of the number passed
*
******************************************************************************

FUNCTION unsqzn
*
* Syntax.: UNSQZN( )
* Where..:
* the squished number
*
*
* Returns: the numeric equivalent of the squished string
*
******************************************************************************

FUNCTION sqzd
*
* Syntax.: SQZD( )
* Where..:
* the date variable
*
* Returns: the squished string representation of the date
*
*
* ---------------------------------------------------------------------------

FUNCTION unsqzd
*
* Syntax.: UNSQZD( )
* Where..:
* the squished date
*
*
* Returns: the date extracted from the character string
*
* ---------------------------------------------------------------------------


POPUPS() - Pop Up Program's SAVE/RESTORE

pop_save( ) - Save pop-up environment
pop_rest() - Restore pop-up environment


FUNCTION pop_save
*
* Syntax: pop_save( )
* Where.:
* expL = .T. saves in PUBLIC variables
* .F. expects calling program to declare variables
* -------------------------------------------------------------------------

FUNCTION pop_rest
*
* Syntax.: pop_rest()
* Returns: .T. - successful, .F. otherwise ( variables not found )
* -------------------------------------------------------------------------


QUEST()

you_sure( [, , , ] )

- Get a YES/NO response


FUNCTION you_sure
*
* Syntax.: you_sure( [,,,] )
* Where..:
* expC1 = optional message, defaults to 'Save these changes (y/n)'
* expC2 = optional default response, defaults to 'Y'
* expN1 = optional display row, defaults to 9
* expN2 = optional display column, defaults to centered
*
* Return.: .T. if Y was pressed, .F. otherwise
* --------------------------------------------------------------------------


WINDOWS() - CLIPPER windowing routines


w_clear( window number ) - Clear a window
w_close( window number ) - Close window, restoring screen
w_display( window number ) - Display a window
w_init( maximum number,default window color ) - Initialize windowing

w_make( top row,top col,bottom row,bottom col,type[,display,title] )
- Define window parameters
w_open( window number ) - Is window open ?

w_pick( window number,maximum choices,options array[,optional heading] )
- Pick an option from a window
w_print( window number,row,column,text) - Prints text relative to
windows
w_release( window number ) - Release a window
w_view( window number, work area, display string)
- View a database through window

FUNCTION w_init
* Purpose: To initialize the memory variables and arrays to hold the windows.
* Returns: - .T. if initialized OK, .F. if parameter error
* Syntax.: w_init( maximum number , default window color )
* ---------------------------------------------------------------------------

FUNCTION w_make
* Purpose: To establish a window parameters, and optionally display it
* Returns: - window number if OK, 0 if no windows are available
* Syntax.: w_make( top row, top column, bottom row, bottom column, type ;
* [display, optional color] )
*
* type = 1 single bar
* 2 double bar
* 3 double top, single sides
* 4 single side, double top
* 5 solid box
* 6 shadowed box
*
* display = .T. to display window immediately
*
* If the function is called with the optional color passed, then the
* default color will be overwritten for this one window. Note, no
* error checking is perform on the color string if passed.
* ---------------------------------------------------------------------------

FUNCTION w_display
* Purpose: To display a predefined window on the screen
* Returns: - .T. if window displayed, .F. if error
* Syntax.: w_display( window number )
* ---------------------------------------------------------------------------

FUNCTION w_close
* Purpose: To close a window and restore the screen
* Returns: - .T. if window close OK, .F. if error
* Syntax.: w_close( window number )
* ---------------------------------------------------------------------------

FUNCTION w_release
* Purpose: To release a window from the system
* Returns: - .T. if release OK, .F. if error
* Syntax.: w_release( window number )
* ---------------------------------------------------------------------------

FUNCTION w_pick
* Purpose: Pick an option from a windowed list
* Returns: pointer to array item, or 0 if ESC was pressed
* Syntax.: ,, [,]
* Where..: expN1 - window number
* expN2 - maximum number of choices
* expC1 - array containing menu options
* expC2 - optional heading
*
* ---------------------------------------------------------------------------

FUNCTION w_print
* Purpose: To display text relative to the windows starting coordinates
* Returns: Nothing
* Syntax.: w_print( window number, row, column, text to display )
*
* ---------------------------------------------------------------------------

FUNCTION w_open
* Purpose: To test whether a window is open or not
* Returns: - .T. if window is open, .F. otherwise
* Syntax.: w_open( window number )
* ---------------------------------------------------------------------------

FUNCTION w_clear
* Purpose: To clear a window
* Returns: - .T. if window is cleared, .F. if error
* Syntax.: w_clear( window number )
* ---------------------------------------------------------------------------

FUNCTION w_view
* Purpose: Select a record number from a work area
* Returns: Record number, or 0 if ESC was pressed
* Syntax.: ,,
* Where..: expN1 - window number
* expC1 - work area to window from
* expC2 - display string to show for each record
*
* ---------------------------------------------------------------------------



 December 10, 2017  Add comments

Leave a Reply