home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
progmisc
/
bldr10b.zip
/
LIBRARY.DOC
< prev
next >
Wrap
Text File
|
1993-03-19
|
75KB
|
3,423 lines
Aeolus Software
Clipper Function Library
COPYRIGHT
(c) 1992 by Aeolus Software
All rights reserved.
FUNCTION LIBRARY REFERENCE GUIDE
TABLE OF CONTENTS
Conventions...............................................1
Procedure and Function Summary............................2
ASC2BIN...................................................5
ADD_REC...................................................6
ASK.......................................................7
APOP......................................................8
BETWEEN...................................................10
BROWSER...................................................11
CENTER....................................................12
CKPRTR....................................................13
DBPUBL....................................................14
DBREPL....................................................15
DBSTOR....................................................16
ERRTONE...................................................17
FEOF......................................................18
FGETS.....................................................19
FIL_LOCK..................................................20
FLD_REPL..................................................21
GEN_MAINT.................................................22
GOT.......................................................25
ISEEK.....................................................27
LSIDE.....................................................28
MAKE_EMPTY................................................29
MAXHNDLS..................................................30
MESSAGE...................................................31
MSGBOX....................................................32
NET_USE...................................................34
NUMERIC...................................................35
OPEN_FIL..................................................36
PADC......................................................37
PADL......................................................38
PADR......................................................39
POP.......................................................40
POP_KEY...................................................43
PUBL_COLO.................................................44
REC_LOCK..................................................45
REL_MAINT.................................................46
RSIDE.....................................................48
SAVE_IT...................................................49
SHADOW....................................................50
THERMOMETR................................................51
TOTALKEYON/TOTALKEYOFF....................................52
WAITKEY...................................................53
WINPOP....................................................54
WINPUSH...................................................55
The Aeolus Procedure and Function Library
Reference Manual
Conventions used in this guide:
<expC>: A characer expression
<expL>: A logical expression (i.e. .t. or .f.)
<expD>: A date expression
<expN>: A numeric expression, a number or calculation
<expA>: An array name
<exp>: An expression that may be of any type
Parameters notated inside square brackets ([]) are optional par-
ameters, defaults will be given where applicable.
Many BUILDER library procedures and functions use one or more
system wide memory variables. These variables must be declared
in the initialization of ALL programs which use this library.
Fortunately the BUILDER code generator does this for you, but if
you would like to code from scratch and use the library be sure
these variables exist before using any library procedures/func-
tions:
SYSDEL - Logical if set to true tells the library that SET
DELETED is ON. If false OFF.
XPLODE - Logical if set to true tells the WINPUSH() function
to explode your windows onto the screen. If false
windows 'pop' onto screen.
MSG_LN - Numeric, the line number where messages are displayed,
should always be set to 24.
NETWORK - Logical if set to true opens files in shared mode and
locks records before writing to files. If false
files are opened EXCLUSIVE.
The 15 color variables - See the PUBL_COLO procedure for their
names.
<1>
The Aeolus Procedure and Function Library
Reference Manual
Alphabetical Proc/Func summary
ASC2BIN(<expC>)
Converts ASCII control indicators to control characters.
*ADD_REC(<expN>)
Adds a blank .DBF record.
ASK(<expC1>,<expC2>,<expN1>,<expN2>[,<expN3>][,<expC3>] ;
[,<expC4>])
Prompt function.
APOP(<expN1>,<expN2>,<expN3>,<expN4>,<expA>,<expN5>,<expC1>[<exp-
C2>][,<expC3>])
Choose multiple menu items from array.
BETWEEN(<exp1>,<exp2>,<exp3>)
Evaluates if expression 1 is greater than and equal to expres-
sion 2 and less than and equal to expression 3
BROWSER WITH
<expN1>,<expN2>,<expN3>,<expN4>[,<expC>][,<expN5>][,<expN6>]
Sets up window to browse a database
CENTER(<expC1>,<expN1>,<expN2>,<expN3>[,<expC2>])
Centers text on the screen or within a window.
CKPRTR(<expN>)
Checks if parallel printer is available.
DBPUBL WITH <expC>
Creates public memory variables from database field variables.
DBREPL WITH <expC>
Replaces database field variables with memory variables.
DBSTOR WITH <expC>
Stores database field variables to memory variables.
ERRTONE([<expN>])
Beep speaker with optional sounds.
FEOF()
Use when reading a .SDF file with FGETS().
FGETS(<expN>)
Returns next record in a .SDF type file.
FIL_LOCK(<expN>)
Locks a file for exclusive type activity.
FLD_REPL WITH <expC1>,<expC2>
<2>
The Aeolus Procedure and Function Library
Reference Manual
Replace one database field in a shared or single user
environment.
GEN_ADDTO WITH ;
<expN1>,<expN2>,<expN3>,<expN4>,<expC1>,<expC2>,<exp>,<expC3> ;
[,<expL>][,<expC4>][,<expC5>]
Generic maintenance for the many database of a one to many
relationship, or a database with very few records. This rou-
tine is used extensively in the BUILDER program.
GEN_MAINT WITH ;
<expN1>,<expN2>,<expN3>,<expN4>,<expC1>,<expC2>[,<expN5>] ;
[,<expN6>][,<expL>]
Generic file maintenance.
GOT(<expC>,<expN1>,<expN2>)
Get field data from a database record number and field number.
ISEEK(<exp>,<expC>,<expN>,<expL>)
Locate a record in a database via an index.
*LSIDE
left arrow logic for drop down menu scrolling.
MAKE_EMPTY(<expC>)
Create an empty memory variable based on the passed variable.
MAXHNDLS(<expN>)
Tests system configuration for number of file handles.
MESSAGE(<expC1>,<expN1>,<expN2>[,<expN3>][,<expC2>])
Display a screen message.
MSGBOX(<expC1>[,<expC2>][,<expC3>][,<expC4>][,<expN1>] ;
[,<expN2>][,<expN3>][,<expN4>])
Display a message box on the screen, optionally ask a ques-
tion.
*NET_USE(<expC1>,<expL>,<expN>,<expC2>)
Network file open function.
NUMERIC(<expC>)
Check a character string for any non-numeric characters.
OPEN_FIL(<expC1>[,<expL1>][,<expC2>][,<expL2>])
All purpose file open routine.
PADC(<expC1>,<expN>[,<expC2>])
Pad a character string to the middle, centering it.
PADL(<expC1>,<expN>[,<expC2>])
Pad a character string to the left, right justify it.
<3>
The Aeolus Procedure and Function Library
Reference Manual
PADR(<expC1>,<expN>[,<expC2>])
Pad a character string to the right, left justifiy it.
POP(<expN1>,<expN2>,<expN3>,<expN4>,<expC1>,<expC2>[,<expL1>] ;
[,<expC3>][,<expC4>][,<expC5>][,<expC6>])
Pick list window function.
PUBL_COLO
Sets default color variables.
*REC_LOCK(<expN>)
Record lock function.
REL_MAINT WITH <expN1>,<expN2>,<expN3>,<expN4>,<expC1>, ;
<expC2>,<expC3>,<expC4>,<expN5>,<expN6>
*RSIDE
right arrow logic for drop down menu scrolling.
SAVE_IT(<expC1>,<expC2>,<expN>,<expC3>)
All purpose file I/O routine.
*SHADOW(<expN1>,<expN2>,<expN3>,<expN4>)
Puts a shadow on a box.
THERMOMETR(<expN1>,<expN2>,<expN3>,<expN4>)
Creates a thermometer to show the progress of a routine.
*TOTALKEYON/TOTALKEYOFF
Enalbles/Disables drop down menu right and left scrolling.
WAITKEY([<expN>])
Works like INKEY(0) but allows SET KEY TO ...'s to be pro-
cessed.
WINPOP()
Remove a window from the screen create with WINPUSH.
WINPUSH(<expN1>,<expN2>,<expN3>,<expN4>[,<expL1>] ;
[,<expL2>][,<expL3>][<expL4>])
Put a window on the screen, may be saved for later removal.
* Procedures and functions preceded by an asterisk (*) are
either dealt with entirely by BUILDER generated code or are
called by another library function. You will probably never
need to use these and are included only for the sake of complet-
ness.
<4>
The Aeolus Procedure and Function Library
Reference Manual
ASC2BIN()
Syntax:
ASC2BIN(<expC>)
Pass:
<expC> string with control character expressions embedded.
Returns:
Character expression. The converted string.
Description:
The ASC2BIN() function converts a character
expression that contains one or more caret (^)
symbols followed by a character to it's 'control'
or binary value. Use this function for creating
printer control strings. For example :
c=ASC2BIN("^A") && caps important
? asc(c) && would display chr(1) -- ASCII for
&& control A
Sample:
***********************************************
** print a message on a laser printer in
** landscape using HP escape sequence
prtrt="^[&l0O" && caret, left bracket (escape),
&& ampersand, lower case L, zero,
&& upper case O
lndscp="^[&l1O" && caret, left bracket (escape),
&& ampersand, lower case L, one,
&& upper case O
set print on
?? asc2bin(lndscp) && set printer to landscape
? "This text printed using landscape."
?? asc2bin(prtrt) && set printer back to portrait
<5>
The Aeolus Procedure and Function Library
Reference Manual
ADD_REC()
Syntax:
add_rec(<expN>)
Pass:
<expN> seconds until timeout, zero for no timeout.
Returns:
a logical expression.
Description:
Attempts to add a blank record to the currently selected data-
base for timeout period of <expN> seconds. If a record cannot
be added after the timeout period an error box is presented to
try again, if No is selected, a logical false is returned. If
<expN> is zero or not passed to the function, ADD_REC() will
wait indefinately.
Comment:
This function is called by the SAVE_IT() function therefore it
should never need to be used by you in a program, use the
SAVE_IT() function to do file I/O instead. It is included here
only for completness.
<6>
The Aeolus Procedure and Function Library
Reference Manual
ASK()
Syntax:
ASK(<expC1>,<expC2>,<expN1>,<expN2>[,<expN3>][,expC3][,<expC4>])
Pass:
<expC1> prompt text.
<expC2> list of acceptable input characters.
<expN1> row for prompt.
<expN2> column for prompt.
<expN3> pad prompt to length.
<expC3> alternate color.
<expC4> "ESC" to allow ESC key.
Returns:
Character expression. The keyboard character pressed.
Description:
<expC1> will be displayed at row <expN1> and column <expN2>.
ASK() will wait until any keyboard character contained in the
list <expC2> is pressed.
<expC2> may be passed in upper or lower case, ASK() does not
distinguish. If you pass "YN" either a lower or upper case 'Y'
key press will return an upper case "Y" from ASK(). Also if you
pass "yn" either a lower or upper case 'Y'key press will return
an upper case "Y".
<expN3> spaces will be displayed before the message in <expC1>
to clear previous text, optional. default is the length of
<expC1>.
<expC3> is color to display <expC1>. Default is current color.
If <expC4> is equal to "ESC" then ASK() can be exited using the
ESC key. If the ESC key is used to exit ASK() a null string
will be passed to the calling procedure. The default is to not
allow ESCaping.
Sample:
*****************************************************
** display the question on line 24 column 0 and pad
** the text to 80 characters. Wait until a Y or N
** is pressed on the keyboard.
answer=ask("Do You Wish to Continue? (Y/N)","YN",24,0,80)
** the character variable "answer" will equal either "Y"
** or "N" depending on what the key is pressed.
<7>
The Aeolus Procedure and Function Library
Reference Manual
APOP()
Syntax:
apop(<expN1>,<expN2>,<expN3>,<expN4>,<expA>,<expN5>, ;
<expC1>[,<expC2][,<expC3>])
Pass:
<expN1> top left row.
<expN2> top left column.
<expN3> bottom right row.
<expN4> bottom right column.
<expA> array name (prefixed with @).
<expN5> max element to show.
<expC1> procedure name to execute.
<expC2> alternate color choice.
<expC3> alternate reverse color choice.
Returns:
Nothing.
Description:
The APOP() function will put a box on the screen using <expN1>
through <expN4> as screen coordinates and allow you to scroll
through elements 1 to <expN5> of the array <expA>. When a
selection is made by pressing the ENTER key that selection will
be bounded by bracket characters (« »). Pressing Ctrl+W will
execute the procedure <expC1>. <expC2> is an optional color
value, <expC3> is an alternate reverse color option. Defaults
for <expC2> and <expC3> are the current colors.
Sample:
********************************************************
** APOP() example code to allow the selection of multiple
** names from a list and then display the selected items.
**
declare names[10] && declare array
names[01]="Rosalind " && initialize array
names[02]="Mark "
names[03]="John "
names[04]="Lisa "
names[05]="Denise "
names[06]="Jeff "
names[07]="Frank "
names[08]="Joe "
names[09]="Cathy "
names[10]="Jerry "
** call APOP()
apop(05,05,13,18,@names,10,"PRT_NMES")
** the bracket character -chr(174)- is left on the array
<8>
The Aeolus Procedure and Function Library
Reference Manual
** elements that have been selected, so if it is in the
** first character position, that element was selected by
** the user
procedure prt_nmes
set print on
set console off
for a=1 to 10
if left(names[a],1)=chr(174)
? trim(subs(names[a],2))+" was selected."
endi
next
<9>
The Aeolus Procedure and Function Library
Reference Manual
BETWEEN()
Syntax:
between(<exp1>,<exp2>,<exp3>)
Pass:
<exp1> value to test.
<exp2> minimum value.
<exp3> maximum value.
Returns:
a logical expression.
Description:
A logical true will be returned if <exp1> is greater than and
equal to <exp2> and less than and equal to <exp3>. The argu-
ments passed to the BETWEEN() function may be of type Character,
Numeric or Date; however all three arguments must be the same
data type.
<10>
The Aeolus Procedure and Function Library
Reference Manual
BROWSER
Syntax:
do browser with <expN1>,<expN2>,<expN3>,<expN4>[,<expC>] ;
[,<expN5>][,<expN6>]
Pass:
<expN1> top left row.
<expN2> top left column.
<expN3> bottom right row.
<expN4> bottom right column.
<expC> key exception function name.
<expN5> start field number.
<expN6> end field number.
Description:
The BROWSER procedure will "browse" the currently selected data-
base using the Clipper DBEDIT() function. <expN1> through
<expN4> define the coordinates of the box that will be dis-
played, <expC> is the user defined function executed on each
key press. <expN5> and <expN6> are the start and end field num-
bers (i.e. the FCOUNT() number) to browse. If <expN5> is not
passed the first field will be browsed. If <expN6> is not
passed the <expN5>th through FCOUNT() fields will be browsed.
For more information on using the <expC> user defined function
consult your Clipper manual on the DBEDIT() function. <expC> is
merely passed to DBEDIT() as the UDF for each key press.
Sample:
******************************************************
** BROWSER sample call
**
select 0
use customer
do browser with 5,3,17,73
** this will put a box on the screen from row 5 column 3 to row
** 17 column 73 and browse all the fields in the database
** CUSTOMER.
<11>
The Aeolus Procedure and Function Library
Reference Manual
CENTER()
Syntax:
center(<expC1>,<expN1>,<expN2>,<expN3>[,<expC2])
Pass:
<expC1> message to display.
<expN1> row to begin centering computation.
<expN2> column to begin centering computation.
<expN3> length for centering computation.
<expC2> alternate color.
Returns:
Start column of centered text.
Description:
The CENTER() function displays <expC1> on row <expN1> column
<expN2> centered within a width <expN3> wide. <expC2> is an
alternate color choice. The default color is the current from
the last SET COLOR TO ... statement.
Sample:
****************************************************
** CENTER() function example
**
** put a box on the screen
winpush(5,5,15,45)
** center text in the box
center("Yoo Hoo, I'm Centered",7,16,29)
inkey(0)
** remove box
winpop()
<12>
The Aeolus Procedure and Function Library
Reference Manual
CKPRTR()
Syntax:
ckprtr([<expN>])
Pass:
nothing or 1, 1 if ESCaping is allowed.
Returns:
a logical expression.
--DESCRIPTION:
The CKPRTR() function returns a logical true if the Clipper ISP-
RINTER() function returns a logical true. CKPRTR() displays an
error box if ISPRINTER() returns false and checks the ISP-
RINTER() function again after a key is pressed.
You can see that an infinite loop will be created if the printer
cannot be brought on-line, if <expN> is a value of one (1) then
the ESC key will allow an exit from CKPRTR() when the printer is
not operating and if ESCaped CKPRTR() will return false (.f.).
--SAMPLE:
*************************************************
** CKPRTR() function example
proc a_report
set device to printer
do while !eof()
if !ckprtr(1) && check printer on each print line
exit
endi
.
print report commands .
.
enddo
>>COMMENT:
The CKPRTR() function will only work with parallel printers.
<13>
The Aeolus Procedure and Function Library
Reference Manual
DBPUBL
Syntax:
do dbpubl [with <expC>]
Pass:
Nothing or public variable prefix character(s). If nothing is
passed, the default is "Q".
Description:
Dbpubl declares a public memory variable for each field variable
in a database. The memory variables created will be prefixed by
<expC>.
If <expC> is not passed "Q" is assumed as the default.
See DBREPL, DBSTOR and SAVE_IT().
Variables are only made PUBLIC and not initialized to any value
therefore all variables will be set to .F. by Clipper at the
completion of this procedure.
Sample:
***************************************************
** DBPUBL example
**
** a database with the following structure is assumed
**
** FNAME Character 15
** LNAME Character 20
** ADDRESS Character 35
** PHONE Character 10
**
select 0
use addrbook
** declares mfname,mlname,maddress,mphone as public
do dbpubl with "M"
Comment:
wise the
uniqueness to your field variables can be lost, I suggest
a length of one, two as an absolute maximum.
<14>
The Aeolus Procedure and Function Library
Reference Manual
DBREPL
Syntax:
do dbrepl [with <expC>]
Pass:
Nothing or variable prefix character(s). If nothing is passed,
the default is "Q".
Description:
DBREPL replaces all the field variables in a record using memory
variables that exactly the same names as the field variables
except they are prefixed with <expC>.
See DBPUBL, DBSTOR and SAVE_IT().
Sample:
***************************************************
** DBREPL example
**
** a database with the following structure is assumed
**
** FNAME Character 15
** LNAME Character 20
** ADDRESS Character 35
** PHONE Character 10
**
select 0
use addrbook
** declares mfname,mlname,maddress,mphone as memory vars
mfname="DENISE"
mlname="JOHNSON"
maddress="123 MAPLE ST"
mphone="6125551234"
appe blan && add a blank record
do dbrepl with "M" && replace all field vars.
Comment:
wise the
uniqueness to your field variables can be lost, I suggest
a length of one, two as an absolute maximum.
<15>
The Aeolus Procedure and Function Library
Reference Manual
DBSTOR
Syntax:
do dbstor [with <expC1>][,<expC2>]
Pass:
<expC1> prefix for memvars, default "Q".
<expC2> nothing for data or "EMPTY" for empty values.
Description:
DBSTOR stores all the field variables in a record to memory
variables with exactly the same names as the field variables
variable except they are prefixed with <expC1>.
If <expC2> is passed as "EMPTY" then all memory variables will
be assigned as if the record were blank.
See DBPUBL, DBREPL and SAVE_IT().
Sample:
***************************************************
** DBSTOR example
**
** a database with the following structure is assumed
**
** FNAME Character 15
** LNAME Character 20
** ADDRESS Character 35
** PHONE Character 10
select 0
use addrbook
** declares mfname,mlname,maddress,mphone as public, you must
** do this in order to use DBSTOR
do dbpubl with "M"
do dbstor with "M","EMPTY" && create 'blank' vars
clea
@ 0,0 say "First Name" get mfname pict "@!
@ 1,0 say " Last Name" get mlname pict "@!"
@ 2,0 say " Address" get maddress pict "@!
@ 3,0 say " Phone" get mphone pict "@R (999) 999-9999"
read
appe blan && add a blank record
do dbrepl with "M" && replace all field vars.
Comment:
<expC> should be kept as short as possible otherwise the
uniqueness to your field variables can be lost, I suggest
a length of one, two as an absolute maximum.
<16>
The Aeolus Procedure and Function Library
Reference Manual
ERRTONE()
Syntax:
errtone([<expN>])
Pass:
Nothing or one (1).
Returns:
Nothing.
Description:
The ERRTONE() function beeps the speaker in one of two ways,
either a two tone error beep if no parameters are passed, or a
short high pitched single tone if one (1) is passed.
<17>
The Aeolus Procedure and Function Library
Reference Manual
FEOF()
Syntax:
feof([<expL>])
Pass:
A Logical Expression or Nothing
Returns:
A logical expression
Description:
The FEOF() function is designed only to be used in conjunction
with the FGETS() function. FEOF() Returns .T. when end of file
is encountered while reading a file using the FGETS() function.
Before using FEOF() you must first initialize its internal vari-
ables by issuing FEOF(.F.). See the example code in the
description for FGETS().
<18>
The Aeolus Procedure and Function Library
Reference Manual
FGETS()
Syntax:
fgets(<expN>)
Pass:
A file handle of a previously FOPEN()'d or FCREATE()'d file.
Returns:
Next logical record in a CR/LF delimited file.
Description:
The FGETS() function will attempt to read the next logical
record in a CR/LF delimited file.
Sample:
***************************************************************
** Sample code to read the AUTOEXEC.BAT file using the **
** Aeolus FGETS() function. **
***************************************************************
** Open the AUTOEXEC.BAT file
hndl=fopen("C:\AUTOEXEC.BAT")
feof(.f.) && initialize FEOF()
do whil !feof()
? fgets(hndl) && read next AUTOEXEC record
endd
fclose(hndl)
<19>
The Aeolus Procedure and Function Library
Reference Manual
FIL_LOCK()
Syntax:
fil_lock(<expN>)
Pass:
<expN> seconds to wait before returning false, zero will not
return false.
Returns:
A logical expression.
Description:
The FIL_LOCK() function will attempt to lock a previously
opened .DBF database, if it fails in <expN> seconds an error box
is displayed allowing the user to try again or abort the
operation. If <expN> is passed as a value of zero then
FIL_LOCK() will wait indefinately to attempt the lock.
FIL_LOCK returns true if the lock is successful and false
if the lock is unsuccessful.
Issuing a successful FIL_LOCK() allows a database opened in
non-exclusive mode to be treated as if it were opened
exclusively. Note that all other file or record locks will
be rejected while you have a successful FIL_LOCK(), be sure
to UNLOCK the file or close the database so others on the LAN
can use it.
Sample:
******************************************************
** Attempt to lock a database previously opened in
** shared mode.
**
set exclusive off && allow file sharing
use addrbook
if fil_lock(5)
report form addr_rpt to print noeject
endi
unlock
Comment:
An alternative to using FIL_LOCK() is simply to open your data-
bases in exclusive mode. Either method will accomplish the same
thing.
<20>
The Aeolus Procedure and Function Library
Reference Manual
FLD_REPL
Syntax:
do fld_repl with <expC>,<exp>
Pass:
<expC> The name of the field in the currently selected
database to be replaced.
<exp> The value to place in the database field <expC>
Description:
Use FLD_REPL whenever you need to REPLACE a single database
field. This procedure will work in a shared or single user
application. Using this procedure on single field REPLACEs
will allow your application to be changed from a single to
multi-user program simply by changing the NETWORK system
variable from .F. to .T.!
Sample:
** replace a date field in the currently selected database
** with today's date - will work if single or multi user
do fld_repl with "CURRNT_DT",date()
<21>
The Aeolus Procedure and Function Library
Reference Manual
GEN_MAINT
Syntax:
do gen_maint with <expN1>,<expN2>,<expN3>,<expN4>,<expC1>, ;
<expC2>[,<expN5>][,<expN6>][,<expL>]
Pass:
<expN1> top left row
<expN2> top left column
<expN3> bottom right row
<expN4> bottom right column
<expC1> DBSTOR prefix character(s)
<expC2> procedure name suffix
<expN5> fast delete index order number
<expN6> number of GET fields
<expL> .T. to allow duplicates in file
Description:
The GEN_MAINT procedure is one of two generic file maintenance
procedures included with the function library and is designed to
be used as an all purpose file maintenance routine.
Before you can call the GEN_MAINT procedure you must first code
four procedures yourself, GSAYS_????, GGETS_????, GEDIT_???? and
GKEY_????. Where ???? is the value passed as <expC2>. The
GSAYS_???? procedure must contain the screen displays,
GGETS_???? the get's, and GEDIT_???? additional code performed
after a READ statement.
Call GEN_MAINT with <expN1> through <expN4> equal to the screen
coordinates required. <expC1> must equal the suffix portion of
the three procedures you write. <expC2> is the prefix character
you want when GEN_MAINT creates memory variables.
Optionally pass <expN5> as the 'fast delete' index order number.
A fast delete index is created by issuing the following Clipper
command:
INDE ON IF(DELE(),"*"," ") TO ...
If <expN5> is not passed or passed with a value of zero the
database will be PACKed on every delete instead. Using the fast
delete, records marked for deletion are used as 'add space' so
your database doesn't grow indefinately. Note that you must use
either SET DELETED ON or SET FILTER TO !DELE() for fast delete
to work correctly.
<expN6> is another optional parameter that should be used if you
have any VALID clauses in your file maintenance. The value
passed in <expN6> should be equal to the number of fields that
are in the file maintenance GET string. If you use this, exec-
cute a CLEAR TYPEAHEAD in the VALID function if an error occurs.
<22>
The Aeolus Procedure and Function Library
Reference Manual
The cursor will be positioned at the error field if a VALID
fails.
And finally <expL> may be passed as true if duplicate records
are to be allowed. The default is false.
You can create your own sample calls to GEN_MAINT by creating
file maintenance windows in BUILDER.
Sample:
proc fmnt_exmpl
** proc to call a generic maintenance routine
**
m_trow=04
m_tcol=30
m_brow=12
m_bcol=67
sele TCSREPS
do gen_maint with m_trow,m_tcol,m_brow,m_bcol,"REPS","Q_"
** screen SAY's for generic maint of sales rep file
**
proc gsays_reps
@ m_trow+2,m_tcol+2 say "Sales Rep #:"
@ m_trow+4,m_tcol+2 say " Last Name:"
@ m_trow+5,m_tcol+2 say " First Name:"
@ m_trow+7,m_tcol+2 say " Phone:"
** screen GET's for generic maint of sales rep file
**
proc ggets_REPS
@ m_trow+2,m_tcol+15 get &g_pfx.SLS_NBR pict "9999"
clear gets
@ m_trow+4,m_tcol+15 get &g_pfx.LAST pict "@!"
@ m_trow+5,m_tcol+15 get &g_pfx.FIRST pict "@!"
@ m_trow+7,m_tcol+15 get &g_pfx.PHONE pict "@R (999) 999-9999"
** Function to edit data called after a screen is keyed but
** before the disk write
**
func gedit_REPS
retu(.t.)
** key GET's for generic maint of division file
**
func gkey_REPS
para gk_func && A-Add, D-Del, C-Change
winpush(m_brow-2,m_bcol-15,m_brow+3,m_bcol+09)
message("Enter Sales Rep Number or Press ESC to Abort",24,00 ;
,80,bmsg_clr)
<23>
The Aeolus Procedure and Function Library
Reference Manual
pcd=space(4)
@ m_brow-1,m_bcol-13 say "Sales Rep #:" get pcd pict "9999"
@ m_brow+1,m_bcol-13 say "Enter Sales Rep # Code"
if gk_func<>"A"
@ m_brow+2,m_bcol-13 say "Blank for Current Rec"
else
@ m_brow+2,m_bcol-13 say "to Add or ESC to Exit"
endi
read
message("",24,00,80,bmsg_clr)
winpop()
&g_pfx.SLS_NBR=if(empty(pcd) .or. ; last-
key()=27,&g_pfx.SLS_NBR,pcd)
retu(pcd)
<24>
The Aeolus Procedure and Function Library
Reference Manual
GOT()
Syntax:
got(<expC>,<expN1>,<expN2>)
Pass:
<expC> database alias name
<expN1> field number in database
<expN2> record number of database
Returns:
an expression of type determined by TYPE(FIELD(<expN1>)).
Description:
Normally used in a valid function to pop up a scroll box and put
the selected item in the READ field.
<expC> is the database alias used for the look up, <expN1> is
<expN1>th field in the database whose alias is <expC>. <expN2>
is the record number in that database, usually the POP() func-
tion.
The return value is whatever is the databases <expN1>th field at
record <expN2>.
Sample:
@ 12,34 say "Building # " get qbldg_nbr pict "!!!!" ;
valid ckbldg()
set cursor on
read
set cursor off
*************************************************************
*** valid function to check the existance of a building ID #
** and pop a scroll box up and allow selection if the keyed
** value is not found in the building file.
**
func ckbldg
v=readvar() && get READ var name
p=&v && get its value
if empty(p) && allow a blank in this function
retu(.t.) && to be a valid entry
endi
of=select() && old file select area
or=recn() && old record (in case same file)
ret_val=.t. && default return value
set softseek on
<25>
The Aeolus Procedure and Function Library
Reference Manual
sele bldg
seek p && look for it
if !found()
k_bldg=space(4)
bldg_fld='bldg_nbr+" "+city'
r=row()
c=col()
set cursor off
** display pop box at row()-1, col()+3 of the field being
** tested.
ckv=got("BLDG",1,pop(r-1,c+3,6,25,"BLDG",bldg_fld,"",.t., ;
.f.,"k_bldg"))
set cursor on
ret_val=.f.
if !empty(ckv) && if a record was chosen
&v=ckv && put it in the READ var
keyboard chr(13) && enter key will display entry
endi
endi
sele (of)
go or
retu(ret_val)
<26>
The Aeolus Procedure and Function Library
Reference Manual
ISEEK()
Syntax:
iseek(<exp>[,<expC>][,<expN>][,<expL>])
Pass:
<exp> expression to SEEK
<expC> database alias name, default is current select alias.
<expN> index order number to use for SEEK command, default used
is the current index order.
<expL> .T. to use SOFTSEEK ON, .F. for SOFTSEEK OFF, default is
the current SOFTSEEK setting.
Returns:
a logical expression.
Description:
The ISEEK() function does an indexed search of a database and
returns the FOUND() condition.
<exp> is the key value to search for, <expC> is the database
alias to SELECT for the indexed search. <expN> is the index
order number to use in the search, if zero or not supplied the
current index order is used. <expL> to true to use 'softseek
on' or false for 'soft-seek off', if <expL> is not passed the
current SOFTSEEK setting is used.
Sample:
******************************************************
** ISEEK() function example
**
select 0
use customer
index on cust_nbr to cstmr1
index on trim(lname)+" "+fname to cstmr2
set index to cstmr1,cstmr2
clea
mcust_nbr=space(9)
@ 1,1 say "Enter Customer Number" get mcust_nbr
read
if iseek(mcust_nbr,"CUSTOMER",1,.f.)
@ 2,1 say "Customer Number Found."
endi
<27>
The Aeolus Procedure and Function Library
Reference Manual
LSIDE
The LSIDE procedure is called by the TOTALKEYON and TOTALKEYOFF
procedures only and should not be used otherwise. Please see
the TOTALKEYON and TOTALKEYOFF procedures for additional infor-
mation. This is included only for completness.
<28>
The Aeolus Procedure and Function Library
Reference Manual
MAKE_EMPTY()
Syntax:
make_empty(<expC>)
Pass:
<expC> existing memory variable name
Returns:
an expression of TYPE(<expC>).
Description:
The memory variable name <expC> is returned in its empty form. A
character variable is spaces the length of the passed variable,
a numeric is returned as zero, etc.
Sample:
******************************************************
*** Make empty function example
***
tst_dat=date()
? make_empty("TST_DAT") && same as ctod(" / / ")
tst_nbr=998
? make_empty("TST_NBR") && same as 0 (zero)
tst_chr="Software Can be Groovy"
? make_empty("TST_CHR") && same as space(22)
<29>
The Aeolus Procedure and Function Library
Reference Manual
MAXHNDLS()
Syntax:
maxhndls([<expN>)
Pass:
Zero/nothing or a numeric expression
Returns:
If zero or nothing is passed MAXHNDLS() returns the smaller of
the CONFIG.SYS FILES= number or the CLIPPER Fnnn file handles.
If a number is passed MAXHNDLS return true if the number of file
handles in the system configuration is equal or greater, other-
wise MAXHNDLS() returns false. If false is to be returned
MAXHNDLS() will display an error box before returning.
Description:
Allows a Clipper program to determine the number of available
file handles in the current system configuration.
Also displays errors if fewer than <expN> file handles are pre-
sent in the current configuration.
<30>
The Aeolus Procedure and Function Library
Reference Manual
MESSAGE()
Syntax:
message(<expC1>,<expN1>,<expN2>[,<expN3>][,<expC2>])
Pass:
<expC1> text to display on the screen
<expN1> row to display
<expN2> column to display
<expN3> length to pad/truncate message text
<expC2> alternate color choice
Returns:
Nothing.
Description:
The MESSAGE() function places <expC1> on the screen at row
<expN1> column <expN2> and pads <expC1> (or trims it) to a
length of <expN3>. <expC2> may be used as an alternate color
choice. If <expN3> is not used, the LEN(<expC1>) is used
instead. If <expC2> is not passed, the current color is used.
Sample:
***********************************************************
*** MESSAGE function example.
***
message("Test Message 1",01,00,80,"+w/b")
inkey(0)
<31>
The Aeolus Procedure and Function Library
Reference Manual
MSGBOX()
Syntax:
msgbox(<expC1>[,<expC2>][,<expC3>][,<expC4>][,<expN1>]
[,<expN2>][,<expN3>][,<expN4>])
Pass:
<expC1> message for line one
<expC2> alternate color choice
<expC3> message for line two - input prompt
<expC4> character list for allowable input (null ("") for
any key)
<expN1> top left row
<expN2> top left column
<expN3> bottom right row
<expN4> bottom right column
Returns:
nothing or a character expression depending on the value of
<expC4>.
Description:
This function puts a message box on the screen and waits for an
acknowledgment.
If only <expC1> is passed as an arguement a box is centered on
the screen sized to fit <expC1> inside. The message is dis-
played in bright yellow with a red background by default, useful
for error messages.
Pass <expC2> as an alternate color choice.
<expC3> and <expC4> usually work together, <expC3> is a prompt
and <expC4> is a list of characters that, when entered from the
keyboard, will remove the box from the screen.
<expC4> need only contain one of each alphabetic character as it
is converted to upper case before being used by MSGBOX().
<expN1> and <expN2> are optional row and column screen positions
for the box.
<expN3> and <expN4> may be passed to optionally size the box.
<32>
The Aeolus Procedure and Function Library
Reference Manual
Sample:
*********************************************************
*** MSGBOX function example
***
msgbox("Error Message")
msgbox("Information Message","+w/b")
if msgbox("Do You Play the Piano?","+w/b","Press Y or N", ;
"YN",10,5)="Y"
msgbox("You Pressed Yes","+w/b")
else
msgbox("You Pressed No","+w/b")
endi
<33>
The Aeolus Procedure and Function Library
Reference Manual
NET_USE()
Syntax:
net_use(<expC1>,<expL>,<expN>,<expC2>)
Pass:
<expC1> database alias name
<expL> .T. for exclusive open, .F. for shared
<expN> error timeout seconds if cannot be opened
<expC2> alias to use when file is opened
Returns:
a logical expression.
Description:
Opens the database <expC1> in exclusive mode if <expL> is true
or non-exclusive if <expL> is false. If <expN> is the seconds
before an error timeout. <expC2> is the alias that will be
used.
Comment:
It is suggested that you use the OPEN_FIL procedure instead of
the NET_USE() function, as it automatically handles error condi-
tions and parameter passing is more convienient.
<34>
The Aeolus Procedure and Function Library
Reference Manual
NUMERIC()
Syntax:
numeric(<expC>)
Pass:
<expC> a string that may or may not contain all numerics
Returns:
a logical expression.
Description:
This function scans every character in <expC> and if every
charcter is between '0' and '9' then it returns true, otherwise
false is returned.
<35>
The Aeolus Procedure and Function Library
Reference Manual
OPEN_FIL()
Syntax:
do open_fil with <expC1>[,<expL1>][,<expC2>][,<expL2>]
Returns:
a logical expression.
Pass:
<expC1> database name to open
<expL1> .T. for shared open, nothing or .F. for exclusive open
<expC2> alias name when open, if other than database name
<expL2> .T. to exit to DOS on open errors, .F. to return false
on open errors.
Description:
The OPEN_FIL function will attempt to open the file <expC1> in
exclusive mode-even if SET EXCLUSIVE OFF is in effect-unless the
second parameter is sent as true. Use the third parameter to
set the alias if you want the alias other than the default of
<expC1>. <expL2> determines how the OPEN_FIL function will react
when it cannot open a .DBF file, passing .T. (or not passing this
parameter) will cause OPEN_FIL to exit to DOS on error conditions.
Passing <expL2> as .F. will cause OPEN_FIL to return a logical
false if it fails to open the file.
The OPEN_FIL function tests for four (4) error conditions. If an
error is detected, an error box is displayed and OPEN_FIL either
exits to DOS or returns false to the application depending on the
value of <expL2>. The errors tested for are as follows:
1. Invalid Alias Name. If no specific alias name is sent to
the OPEN_FIL function the file name (<expC1>) is used. A
valid alias name must contain the letter 'A' through 'Z' in the
first character position. The second through tenth character
positions can contain 'A' through 'Z', '0' through '9' or '_'.
2. File not found. Before a database is USEd OPEN_FIL tests the
the Clipper FILE() function to determine if the file exists.
3. Already in Use. The database is already USEd in EXCLUSIVE mode
or the file has been locked.
4. .DBT file is missing. OPEN_FIL tried to USE a database but the
memo field data file (.DBT file) is missing.
<36>
The Aeolus Procedure and Function Library
Reference Manual
PADC()
Syntax:
padc(<expC1>,<expN>[,<expC2])
Pass:
<expC1> text to pad/truncate
<expN> length of returned string
<expC2> fill character, default is space
Returns:
a character expression.
Description:
This function pads or trims <expC1> to a length of <expN> using
<expC2> as the fill character. PADC() returns a centered
character string.
<37>
The Aeolus Procedure and Function Library
Reference Manual
PADL()
Syntax:
padl(<expC1>,<expN>[,<expC2])
Pass:
<expC1> text to pad/truncate
<expN> length of returned string
<expC2> fill character, default is space
Returns:
a character expression.
Description:
This function pads or trims <expC1> to a length of <expN> using
<expC2> as the fill character. PADL() returns a right justified
character string.
<38>
The Aeolus Procedure and Function Library
Reference Manual
PADR()
Syntax:
padr(<expC1>,<expN>[,<expC2])
Pass:
<expC1> text to pad/truncate
<expN> length of returned string
<expC2> fill characte, default is space
Returns:
a character expression.
Description:
This function pads or trims <expC1> to a length of <expN> using
<expC2> as the fill character. PADR() returns a left justified
character string.
<39>
The Aeolus Procedure and Function Library
Reference Manual
POP()
Syntax:
pop(<expN1>,<expN2>,<expN3>,<expN4>,<expC1>,<expC2> ;
[,<expL>][,<expC3>][,<expC4>][,<expC5>][,<expC6>]
Pass:
<expN1> top left row for picklist box
<expN2> top left column for picklist box
<expN3> picklist height in rows
<expN4> picklist width in columns
<expC1> database alias name
<expC2> expression to display on each picklist line
<expL> enable QWERTY scroll function, default false.
<expC3> memvar for QWERTY scroll initialization (prefix with @)
<expC4> color for pointer bar, if not using WREV_CLR
<expC5> procedure to execute on ENTER key
<expC6> database fieldname for bounded picklist
Returns:
a numeric expression. The record number selected.
Description:
The POP() function creates a scrollable pick list box to be pre-
sented on the screen.
<expN1> and <expN2> are the row and column of the upper left
corner of the pick list box.
<expN3> and <expN4> are the height and width of the box respec-
tively
<expC1> is the database alias to 'browse'.
When <expC2> is evaluated as a macro it is displayed on each
line in the box.
If <expL> is passed as true then a field delimited with square
brackets will be placed on the top of the box. Any QWERTY text
entered will be displayed between the brackets and that text
will change the data displayed in the box to use that as the key
Warning: Do not set <expL> to true if you are going to use
<expC6>
<expC3> is used in conjunction with <expL> and contains the name
of the memory variable that contains the starting key value to
be placed between the square brackets. If you choose to set
<expL> to true and not use this argument the QWERTY area will be
sized according to the length of the INDEXKEY(0) function.
<expC4> is an optional color for the pointer bar.
<40>
The Aeolus Procedure and Function Library
Reference Manual
<expC5> is an optional (strongly reccomended) name of a proce-
dure to be executed on selection of an element.
Warning: <expC5> can only contain the procedure name and cannot
contain a 'WITH' clause or parameters.
<expC6> is an optional fieldname that will restrict scrolling
only while the fieldname passed is equal to the value on entry
into the POP() function. The database must be sorted or indexed
so that the passed fieldname will have the same value for a con-
tiguous series of records.
Warning: <expC6> can only be use if <expL> is set to false.
Sample:
*****************************************************
* This example displays a pick list box at row 2
* column 40, it is 9 rows tall and 23 columns wide.
* It displays the field COUNTRY from the database
* INTRNTNL and provides the user a field to enter QWERTY
* text to move to different parts of the database.
* If a record is selected the procedure INTL_DTL is executed.
sele intrntnl
go top
** display international
**
sele intrntnl
kf=space(20)
intl_rec=pop(02,40,9,23,"INTRNTNL","country","",.t., ;
@KF,"","intl_dtl")
Sample2:
*****************************************************
* This example displays a pick list box at row 2
* column 19, it is 9 rows tall and 20 columns wide.
* It displays the fields PART_NBR and PART_END from the
* database MSPART.
* If a record is selected the procedure MS_DETAIL is executed.
k_part_nbr=space(8)
sele mspart
go top
** display part list
**
sele mspart
kf="K_PART_NBR"
<41>
The Aeolus Procedure and Function Library
Reference Manual
ms_fld='if(empty(part_nbr),space(17),part_nbr+"-"+part_end)'
prt_rec=pop(02,19,9,20,"MSPART",ms_fld,"",.t.,,"","", ;
"ms_detail")
<42>
The Aeolus Procedure and Function Library
Reference Manual
POP_KEY
The POP_KEY procedure is called by the POP() function only and
should not be used otherwise. Please see the POP() function for
additional information. This is included only for completness.
<43>
The Aeolus Procedure and Function Library
Reference Manual
PUBL_COLO
Syntax:
do publ_colo
Pass:
Nothing
Description:
The BUILDER executes this procedure in the initialization of all
the programs it creates. This procedure creates several public
variables and initializes them for use by the program.
The initialized variables are:
HDR_CLR screen header box color
HDR_MSG header message color
BKGD_CLR screen background color
BMSG_CLR background message color
BERR_CLR background error color
BREV_CLR background reverse color
WNDW_CLR window color
WMSG_CLR window message color
WERR_CLR window error color
WREV_CLR window reverse color
WNDW2_CLR secondary window color
WMSG2_CLR secondary window message color
SHDW_CLR shadow color
ERR_CLR error box color
MSG_CLR message line color
Most of these are modifiable using the Color option of the
BUILDER main menu.
<44>
The Aeolus Procedure and Function Library
Reference Manual
REC_LOCK()
Syntax:
rec_lock(<expN>)
Pass:
<expN> seconds before error timeout, pass zero to never timeout.
Returns:
A logical expression.
Description:
Attempts to lock lock the record of the currently selected data-
base for timeout period of <expN> seconds. If the record cannot
be locked after the timeout period an error box is presented to
try again, if No is selected, a logical false is returned. If
<expN> is zero or not passed to the function, REC_LOCK() will
wait indefinately.
Comment:
The SAVE_IT() function performs all record locking before any
file I/O and you should not have to use this function.
However...
some shops require that a record is locked during editting and
all the functions and procedures here only lock a record immedi-
ately before any file I/O so you may need to use this function.
<45>
The Aeolus Procedure and Function Library
Reference Manual
REL_MAINT
Syntax:
DO REL_MAINT WITH <expN1>,<expN2>,<expN3>,<expN4>,<expC1>, ;
<expC2>,<expC3>,<expC4>,<expN5>,<expN6>
Pass:
<expN1> The row number to put the Add/Change/Delete menu,
usually the top border of the window.
<expN2> The column number for the Add/Change/Delete menu,
yes, you calculate to center it.
<expN3> The row number for messages, usually the bottom line
of the box, not the border but inside the box.
<expN4> The column number for messages, usually two spaces to
the right of the left window border.
<expC1> You must declare a procedure that contains the GETs for
the maintenance the first three letters of which must
be 'GET'. Pass in <expC1> the characters you add to
make the procedure unique.
<expC2> The condition that relates the file to be editted, this
must be a logical true when evaluated as a macro. All
contigious records where the condition remains true
will be available for editting.
Note: The SET RELATION TO ... command does NOT need to
be in effect to use this procedure, the databases merely
need to have a one to many relationship.
<expC3> Database alias name to be editted.
<expC4> Memory variable prefix character(s).
<expN5> The 'delete index' order number, zero (0) if a 'delete
index' is not used.
<expN6> The number of fields to be editted.
Description:
The REL_MAINT procedure is used to edit the 'many' records in
the child database when a one-to-many database relationship
exists.
This procedure is designed to be easily created from a BUILDER
dialog box.
If you are unsure what a 'delete index' is refer to the
GEN_MAINT procedure for clarification.
Look carefully at the following sample to see how to set up a
REL_MAINT call.
Sample:
** note: prior to calling rel_maint all fields in the database
** have been copied to memory variables with identical names
** except the memory variables (in this example) are prefixed
** with the letter "Q". See DBPUBL, DBSTOR for more info.
<46>
The Aeolus Procedure and Function Library
Reference Manual
************************************************
** CALLED BY: Pick List Window Proc: PLST003 **
** Comment: Model Maint Dialog **
************************************************
proc dlog004
private dr1,dc1,dr2,dc2
** save key to a memory variable
** important you code something like this!
rpartno=model->partno
dr1=15
dc1=45
dr2=dr1+04
dc2=dc1+32
set colo to (wndw_clr)
winpush(dr1,dc1,dr2,dc2)
@ dr1+02,dc1+04 say "Model Number"
** call rel_maint to edit all contigious records in the MODEL
** database with the field MODEL->PARTNO equal to the memory
** variable RPARTNO.
do rel_maint with ;
dr1,dc1+6,dr2-1,dc1+2,"004","MODEL->PARTNO=RPARTNO", ;
"MODEL","Q",2,1
winpop()
** this proc created by copying the GETs created by BUILDER to
** a proc with the first three characters equal to "GET", I
** arbitrarily chose "004" as the second part of the name (
** because it matches DLOG004) and pass "004" as the fifth
** parameter above.
proc get004
** absolutely IMPERATIVE the key variables get set from
** previously saved memory variables here!!
qpartno=rpartno
@ dr1+02,dc1+18 get qmodel pict "@!"
Not including the comments only four lines of code were added to
a BUILDER dialog box to create this (many more were deleted).
This is a small example, but should clearly show how to set up a
REL_MAINT of your own.
<47>
The Aeolus Procedure and Function Library
Reference Manual
RSIDE
The RSIDE procedure is called by the TOTALKEYON and TOTALKEYOFF
procedures only and should not be used otherwise. Please see
the TOTALKEYON and TOTALKEYOFF procedures for additional infor-
mation. This is only included for completness.
<48>
The Aeolus Procedure and Function Library
Reference Manual
SAVE_IT()
Syntax:
save_it(<expC1>,<expC2>,<expN>,<expC3>)
Pass:
<expC1> "ADD", "CHG" or "DEL" only
<expC2> memory variable prefix character(s)
<expN> fast delete index order number
<expC3> database alias name
Returns:
a logical expression.
Description:
The SAVE_IT() function will add, change or delete the current
record from the database <expC3>. The SAVE_IT() function uses
file locking if the memory variable NETWORK is set to true. The
<expC1> argument must be equal to "ADD", "CHG" or "DEL" to tell
SAVE_IT() to add, change or delete a record. <expC2> is the
character or characters the field variables are prefixed with to
create the memory variables (See the DBPUBL and DBSTOR proce-
dures). Use <expN> to pass the order number of the "fast
delete" index order number created like:
INDEX ON IF(DELE(),"*"," ") TO ...
Send <expN> as zero (0) if you are not using a "fast delete". If
the NETWORK memory variable is set to true and the SAVE_IT()
function cannot lock the requested record and the user replies
"No" to try the lock again, then the SAVE_IT() function will
return false.
Sample:
*************************************************************
*** SAVE_IT() function example
***
select 0
use customer inde cust1,cust2
do dbpubl with "Q" && setup memvars
do dbstor with "Q","EMPTY" && set original values
** cust1 indexed on cust_nbr
** cust2 indexed on if(dele(),"*"," ")
. change memvars to values for new record
.
if !save_it("ADD","Q",2,"CUSTOMER")
msgbox("ERROR--RECORD NOT ADDED !")
return
endi
<49>
The Aeolus Procedure and Function Library
Reference Manual
SHADOW()
Syntax:
shadow(<expN1>,<expN2>,<expN3>,<expN4>)
Pass:
<expN1> top left row
<expN2> top left column
<expN3> bottom right row
<expN4> bottom right column
Description:
Places a shadow on the area bounded by the four passed coordi-
nates, where <expN1> and <expN2> are the upper left row and col-
umn coordinates and <expN3> and <expN4> are the lower right.
Comment:
the WINPUSH procedure uses this function to place a shadow on
the window it creates. You therefore should not have to use
this function.
<50>
The Aeolus Procedure and Function Library
Reference Manual
THERMOMETR()
Syntax:
thermometr(<expN1>,<expN2>,<expN3>,<expN4>)
Pass:
<expN1> thermometer length
<expN2> start value of operation (i.e. 0%)
<expN3> maximum value of operation (i.e. 100%)
<expN4> current value, must be between <expN2> and <expN3>
Returns:
a character expression.
Description:
The THERMOMETR() function is used to display the progress of
iterative program activity graphically. The <expN1> argument is
the length you want your thermometer, <expN2> is the number of
the starting position of your process, <expN3> is the ending
position and <expN4> is the current position.
Sample:
***************************************************************
** THERMOMETR() function example
**
select trnsctn
go top
strt=recno()
end=reccount()
width=40
othm=" " && old thermometer for comparison
do whil !eof()
thm=thermometr(width,strt,end,recno())
if thm <> othm && only display changes
@ 1,0 say thm
othm=thm
endi
.
.
.
skip
endd
<51>
The Aeolus Procedure and Function Library
Reference Manual
TOTALKEYON/TOTALKEYOFF
Syntax:
do totalkeyon
do totalkeyoff
Description:
Sets up the left and right arrow keys to jump from one drop down
menu to the menu under the right or left.
Comment:
The BUILDER program creates the source with TOTALKEYON and
TOTALKEYOFF aleady called at the proper places and you should
not need to use this procedure.
<52>
The Aeolus Procedure and Function Library
Reference Manual
WAITKEY()
Syntax:
waitkey([<expN>])
Pass:
<expN> timeout seconds
Returns:
a numeric expression.
Description:
Use WAITKEY() as a substitute for the Clipper INKEY(<expN>)
function. The only difference between the two is that WAITKEY()
will react to any SET KEY TO ... 's you have set. Not passing
the parameter or passing zero (the default) will cause WAITKEY()
to wait until a key is pressed with no timeout.
<53>
The Aeolus Procedure and Function Library
Reference Manual
WINPOP()
Syntax:
winpop()
Pass:
Nothing
Returns:
A logical value, true if there was something removed from the
screen.
Description:
The WINPOP() function removes the last window on the screen that
was created by the WINPUSH function.
See WINPUSH() for examples.
<54>
The Aeolus Procedure and Function Library
Reference Manual
WINPUSH()
Syntax:
winpush(<expN1>,<expN2>,<expN3>,<expN4>[,<expL1>] ;
[,<expL2>][,<expL3>][,<expL4>])
Pass:
<expN1> top left row
<expN2> top left column
<expN3> bottom right row
<expN4> bottom right column
<expL1> save the screen area before displaying, default true
<expL2> clear the interior of the box, default true
<expL3> display the box with a border, default true
<expL4> display the box with a shadow, default true
Returns:
A logical value, if the window was successfully displayed, true
is returned.
Description:
The WINPUSH function saves the portion of the screen bounded the
coordinates <expN1> through <expN4> with <expN1> and <expN2>
being the upper left row and column positions and <expN3> and
<expN4> the lower right corner positions and draws a box on the
screen in the default color.
All four of the logical expressions that can optionally be
passed have a default value of true.
If <expL1> is true the screen area bounded by the passed screen
coordinates is saved to the screen array otherwise if set to
false it cannot be WINPOPed.
<expL2> if set to true will clear the box interior otherwise
only the border, if any, is displayed. The default it true.
<expL3> if set to true will display a double border on the box.
<expL4> controls the shadow on the box, if set to true a shadow
is displayed.
Note: If the variable XPLODE is a logical variable set to true
the WINPUSH function will explode the window onto the screen.
Sample:
**************************************************************
*** WINPUSH/WINPOP sample code
***
** put a window on the screen
** saving the area so it can be WINPOPed,
<55>
The Aeolus Procedure and Function Library
Reference Manual
** clearing the inside of the window when displayed,
** put double border charcters on the window,
** and put a shadow on the window.
winpush(05,10,17,60)
@ 07,12 say "My Window to the World."
inkey(0)
** remove window, and shadow.
winpop()
<56>