home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
browsevt.zip
/
BROWSE.DOC
next >
Wrap
Text File
|
1987-04-19
|
6KB
|
147 lines
Last revision: April 19, 1987 at 7:44
Synopsis of the BROWSE command in the VANT object code library
The Clipper compatible BROWSE command in the VANT Library is called
simply as you would any user written procedure. Two optional parameters
may be specified. The syntax is:
DO BROWSE WITH [fields_list,[edit_flag]]
The defaults of these parameters are, all fields and editing allowed.
IMPORTANT: A database file must be opened in the current work area when
BROWSE is called. The database may have an opened index(s) associated
with it when BROWSE is called. Also, if the currently selected file is
indexed, BROWSE will know and enables a SEEK to the key command. The
menu is modified in its upper right hand corner if Seeking is enabled.
Fields_list is an array of field names of currently opened DBF files
and the ALIAS->FieldName notation should used for non-selected files.
Some users may not wish to allow editing and deletions from the BROWSE
command and for this reason, the edit_flag is provided. If specified
as .F. then the BROWSE command is modified so as to not allow any
editing, appending, and/or deletions and the menu is accordingly also
modified as if those BROWSE command didn't exist. Pressing the F1 or
H keys when editing has no effect if the edit_flag is .F.
Both these parameters are optional, however if both are specified, the
fields_list MUST proceed the edit_flag.
When editing, a remember last arrow direction feature is enabled which
will move the cursor in the same direction used to arrive at the
field being edited. Unfortunately, this feature will not work in the
moving left direction. It is handy to have the cursor keep moving in
the same direction after each edit.
If editing a key field in an indexed database, the record will be
repositioned after the edit, if the changes causes the active index to
be modified. Press 'S' to determine what is the key field(s) of an
indexed database.
The BROWSE command makes no environmental changes. The ScoreBoard may
be either On/Off. The non-networked BROWSE uses the left side of the
first line for information, network messages are displayed on right.
Please note that BROWSE saves the screen when called and then restores
the screen when control is returned to the caller. The Clipper
SAVE/RESTORE SCREEN command may be in use when BROWSE is called since
the BROWSE screen save uses its own internal screen storage buffer.
The file will be positioned with the current record as the first on the
BROWSE screen. If the record position is moved while in BROWSE, the
database will be repositioned when control is returned to the caller.
It is suggest that the caller take the possible reposition of the
database into account when using the BROWSE command.
If the database file is positioned to its logical EOF by using the down
arrow, and editing is allowed, the message "Add a blank record?"
appears at the bottom of the screen. If when adding records by this
method, and an index is in use, it is suggested that the first field
added to the blank record be the key field. Otherwise the new blank
record will appear to be at the beginning of the file after the first
field is added.
If the key field is the selected field column when a new blank record is
added to an indexed database, and the proper key information is added to
the key field, the newly added record will be positioned in its proper
logical order which may assist in filling in the rest of that record's
data.
First, an example of using BROWSE to show all fields with editing.
DO BROWSE
Gee, now that wasn't so hard!
Here is an example of using BROWSE to only show three specific fields
in a data base that is open and currently selected. The three fields
are called, LastName, Company, and City. Also, since we don't wish to
allow editing, deleting or appending, a false edit_flag is specified.
DECLARE fields[3]
fields[1] = "LASTNAME"
fields[2] = "COMPANY"
fields[3] = "CITY"
DO Browse WITH fields, .F.
Say you also wanted to show a fourth field in some other open, related
database, linked to the currently selected database via a "SET RELATION
TO linkfield INTO otherfil", you would just add it to the fields_list
as follows, being sure to specify its alias:
DECLARE fields[4]
:
fields[4] = "OTHERFIL->FIELDNAME"
If the editing flag is true, you may edit the field(s) in that other
open but not selected database. Appeding and record deleting is only
done in the currently selected database.
This version of BROWSE ver3.0 uses the DBEDIT() function in the
Clipper Autumn '86 release two. It MUST be linked with the DBU.LIB
which comes with Clipper A86.
Read Clipper's documentation regarding DBEDIT() for more info. PLEASE
note that memo fields are not allowed and no check is made for valid
field names when DBEDIT() is called. If a character field is longer
that 78, the field will be truncated but edited in a sliding window.
A alternative networking version of this BROWSE is available which
implements full record locking. It is used in exactly the same manner
as is the standard BROWSE in the VANT.LIB library except there is
recording locking before deleting/recall a record, deleteing a field,
editing a field, or appending a new record. The standard Clipper file
locking functions are called to lock the records. If the locking fails
a "WAIT" message is displayed and after about 5 seconds, a warning
messsage is displayed on right side of top line and the bell is sounded
to inform the operator to press a key to continue. It is assumed that
the file to browse has been opened in either shared or exclusive mode.
The networking version of BROWSE may be used in non-networked programs.
No changes are necessary, just use it in exactly the same manner for
either type application.
NOTE: There is a bug in Clipper Autumn '86 DBEDIT() function that
sometimes cause the screen to become totally confused and write
stuff all over the place. The problem will not appear with all files
but seems to be a function of the number and/or length of fields.
It usually shows up when you use ^END to move to the right edge and
then use ^<-- to pan back across. Sorry but I can't fix that...
H.M. Van Tassell
123 Hill Hollow Road
Watchung, NJ 07060
(201)755-5372
[eof]