home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
b
/
btvw120a.zip
/
BTVIEWER.DOC
< prev
next >
Wrap
Text File
|
1992-12-08
|
70KB
|
1,776 lines
BTVIEWER
A Btrieve file Query and Reporting Utility
Version 1.20A
By
Access Microsystems Inc.
404 Midstreams Road
Brick, NJ 08724-3838
(908) 892-2683
CIS: 74040,607
TABLE OF CONTENTS
1. Who made BTVIEWER? Why?
2. What does BTVIEWER require?
3. What does BTVIEWER do?
A. Intended actions
B. Unintended actions (dare we say BUGS?)
4. Details...
A. Starting BTVIEWER
B. The Main Menu
C. The File Sub-menu
1. Cloning a Btrieve file
2. Packing a Btrieve file
3. Copying a Btrieve file
4. Test/Rebuild a Btrieve file
5. Misc. Btrieve Functions
a. Set Owner
b. Clear Owner
c. Statistics
d. Btrieve Version
e. Create file from BTB file
f. Supplemental Index
g. Transactions
8. Exiting BTVIEWER
D. The View Sub-menu
1. File
2. Field
a. Add Fields
b. Delete Fields
c. Clear Fields
d. Define Summary
e. Print/Display Summary
f. Joins
3. Restrict
a. Add/Edit Restrictions
b. Clear Restrictions
4. Sort
5. Display/Edit
6. Print
7. Import/Export
a. Import View
b. Export View
8. Modify All in View
a. Modify All
b. Delete All
9. Save/Load View
a. Save current View
b. Load View
E. The Options Sub-menu
1. Set Colors
2. Set Misc. Parameters
3. Reset Btrieve
4. REGISTER BTVIEWER
H. The Help Sub-menu
1. List Error Codes
2. List Operation Codes
3. Btrieve Page Size Calculator
4. About BTVIEWER
5. Getting help/making suggestions/future directions
1. Who made BTVIEWER? Why?
BTVIEWER is a product of Access Microsystems Inc. We do
programming in C and C++ under DOS and UNIX, often
using Btrieve as a file manager. (If you have a
project we might be able to help with, contact us at
the phone or Compuserve number on the first page of the
documentation or throughout the software.)
We have used several programs for looking at,
recovering data from, and editing Btrieve files. We
have been disappointed by the results. Some crashed,
others worked but punished us in the process. We
thought that there must be a better way, and set out to
design such a product. BTFILER was our first attempt at
such a program. It remains a popular product, and has
become a very competent Btrieve File Recovery and
Maintenance tool, with recovery options for the most
damaged Btrieve files. BTFILER has a registration price of
$29.00 (+4.00 S&H) and is available from Access
Microsystems Inc.
BTVIEWER is a more sophisticated tool for viewing and
querying Btrieve files that have .DDF description files.
While the HEX Edit bit twidling done by BTFILER is
sometimes useful, it is often useful to look at and
minipulate the data in Btrieve files in other ways.
If BTVIEWER meets a need, please register! Also, think
about the possibility of getting a distribution license
and making BTVIEWER part of your Btrieve application.
DISCLAIMER - AGREEMENT
Users of BTVIEWER must accept this disclaimer of
warranty:
"BTVIEWER is supplied as is. The author disclaims all
warranties, expressed or implied, including, without
limitation, the warranties of merchantability and of
fitness for any purpose. The author assumes no
liability for damages, direct or consequential, which
may result from the use of BTVIEWER."
For Non-Registered Users:
BTVIEWER is a "shareware program" and is provided at no
charge to the user for evaluation. Feel free to share
it with your friends, but please do not give it away
altered or as part of another system. The essence of
"user-supported" software is to provide personal
computer users with quality software without
high prices, and yet to provide incentive for
programmers to continue to develop new products. If
you find this program useful and find that you are
using BTVIEWER and continue to use BTVIEWER after a
reasonable trial period, you must make a registration
payment of $79.00 (+4.00 S&H) to Access Microsystems Inc.
The $79.00 registration fee will license one copy for use
on any one computer at any one time. You must treat
this software just like a book. An example is that this
software may be used by any number of people and may be
freely moved from one computer location to another, so
long as there is no possibility of it being used at one
location while it's being used at another. Just as a
book cannot be read by two different persons at the same
time, a single copy of BTVIEWER cannot be used in two places
at once, unless the license is being violated.
Commercial users of BTVIEWER must register and pay for
their copies of BTVIEWER within 30 days of first use or
their license is withdrawn. Site-License arrangements
may be made by contacting Access Microsystems Inc. or
by filling out the registration form found in
REGISTER.DOC or produced by BTVIEWER. See the
Options/Register BTVIEWER menu option.
You are encouraged to pass a copy of BTVIEWER along to
your friends for evaluation. Please encourage them to
register their copy if they find that they can use it.
All registered users will receive:
A copy of the latest version of the BTVIEWER
system.
A printed manual.
Notice of future upgrades.
Information on future products.
Support for a MINIMUM of 90 days.
A copy of our BU partial BUTIL replacement
program. This program STOPs, RESETs Btrieve,
shows BTRIEVE version and CLONEs Btrieve files.
You may distribute this freely.
2. What does BTVIEWER require?
BTVIEWER requires:
An IBM PC or compatible with 512 K (640K
recommended for large variable length records).
MS/PC DOS version 2.0 or better. Version 4.00 is
a known problem, so if you have a problem and you
have version 4.00 of MS/PC DOS, UPGRADE DOS FIRST!
Btrieve version 4.11 or better. Make sure to
tailor your Btrieve start-up parameters (See "Set
Misc. Parameters" in the File Sub-menu).
.DDF Files containing file layouts for your Btrieve
files. We currently do not offer a .DDF
Creation/Editing tool, but we are working on it.
BTVIEWER also requires and is shipped with the
following files:
BTVIEWER.DOC This file
BTVIEWER.BER A file with Btrieve Error
codes listed
BTVIEWER.BOP A file with Btrieve Operation
codes
BTVIEWER.MNU A Menu Control File
BTVIEWER.HLP A Help file.
BTVIEWER.MSK Formatting information -
PROPRIETARY FORMAT!
BTVIEWER.CF1 A configuration file
BTVIEWER.EXE The executable file. Run this
to use BTVIEWER.
REGISTER.DOC A file with a BTVIEWER registration
form. (Registration can be
printed by the program itself
as well.)
AMIMAP.EXE A BONUS utility program that
lists the amount of memory
taken up by resident
programs like Btrieve
SAMPLE.BTB A sample BTrieve Build ASCII
file, used to create Btrieve
Files (File/Misc. Btrieve
Functions/Create file from BTB).
SAMPLE.BTS A sample BTrieve Supplemental
index ASCII file, used to
create a Supplemental Index.
FILE.DDF
FIELD.DDF
INDEX.DDF Data Description files for the sample
file CUSTS.DAT
CUSTS.DAT Sample Customer file to try things
out on.
REGISTER.DOC A file containing a
registration form.
CINSTALL.DAT A Color configuration file.
This file contains a single line of text.
The line has 7 sets of 3 digit numbers, each
3 digit number representing one of the types
of colors used by BTVIEWER. THIS FILE
SHOULD BE PLACED IN A DIRECTORY THAT IS
ON YOUR DOS PATH SO THAT YOU WILL ALWAYS
READ THE SAME COLOR FILE! The file should
look like this:
rrrmmmooodddsssbbbnnn
Where:
rrr=decimal "regular" color.
mmm=decimal "menu" color.
ooo=decimal "selected menu option"
color.
ddd=decimal "active data entry field"
color.
aaa=decimal "status line" color.
bbb=decimal "box" color.
nnn="Hot" letter in menu option
BTVIEWER may, from time to time, create the
following files:
BTVIEWER.CF2 A second configuration file.
TMP?????.$$$ Temporary files created to
save the state of the screen, etc. These may
be deleted if you are SURE that no copy of
BTVIEWER is running on the system or on a
network the system is connected to.
3. What does BTVIEWER do?
A. Intended actions
BTFIEWER allows you to create, save and restore
"views" of your data. "Views" include a file, a set
of fields, a sorting order, and a set of restrictions.
Data is viewed and exited in a convenient format
(dates like 06/17/1992, binary numbers presented like
123.45, etc.). You also may edit fields in a HEX
format as an option.
BTVIEWER allows you to JOIN two files based upon a
field in a primary file and an index in a secondary
file, including all records, all records with a match in
the secondary file, or all records without a match in
the secondary file.
BTVIEWER allows you to restrict your "view" of a file
using a "query by form" screen. You may also
modify all records in the view with a "modify by
example" screen, or delete all records in a view.
BTVIEWER allows you to generate summary information
(MIN, MAX, SUM, AVG) and allows a calculated field,
that is, a field in a view that is calculated from
constants and other fields.
BTVIEWER allows you to RECOVER data from damaged
Btrieve files. BTFILER, our Btrieve File Maintenance
and Recovery Utility offers more complete file
rebuilding, so consider it if you have severe data
corruption problems.
BTVIEWER allows you to Clone a Btrieve file (That
is, create an empty Btrieve file with the same key
structure and record size as the original).
BTVIEWER allows you to Pack a Btrieve file (That
is, create a copy of a Btrieve file less the space
left by deleted records) as well as Copy a file (That
is, copy records from one Btrieve fiole to another,
with the destination file possibly having a different
record length and key structure).
BTVIEWER allows you to Import and Export records in
comma-delimited ASCII! You may Export into dBASE III
compatible files.
BTVIEWER allows you to create a Btrieve file with a
BTrieve Build file (.BTB) file and create a
supplemental index using a BTrieve Supplemental
(.BTS) file. You may also DROP a supplemental
index.
BTVIEWER allows you to begin and end transactions
within a single session, and will prompt you to
end the transaction if you try to do something
that can't be done in a transaction.
BTVIEWER allows you to repeat repetitive tasks by
creating keystroke files that get passed back to
the keyboard buffer as the program is run. This
also allows more technical users to provide easy
to use batch files for those less comfortable
operating BTVIEWER directly. (See Appendix B).
BTVIEWER allows you to Set and Clear owners of
Btrieve files, displays Btrieve version
information, and shows file statistics and key
structure.
BTVIEWER lists Btrieve Error codes (arranged
numerically) and Operation codes (arranged
alphabetically). You may also get details on
Btrieve error codes.
BTVIEWER lets you choose from 4 different color
sets, or customize colors.
B. Unintended actions (dare we say BUGS?)
As of this writing date, there are no known bugs.
(Kind of reminds us of the compiler that reports,
after a successful compile, "None of the errors
were found").
It is likely that VERY large variable length
records will cause problems with memory (but we
have not tested it with very large (>25K) variable
length records). Please let us know if you run
across any problems. See section 5, Getting
help/making suggestions.
4. Details...
In the following sections, we detail actions required
to make BTVIEWER do work for you. This assumes you have
placed the files mentioned above (What does BTVIEWER
require?) in your "PATH".
For instance, if you type in PATH<Press ENTER> from the
DOS prompt (commonly "C:\>>") and you see the
following:
PATH=C:\;C:\DOS;C:\UTIL
you should place the BTVIEWER file in the C:\, C:\DOS or
the C:\UTIL directory. You must also have Btrieve
loaded, or if so configured, Btrieve or Brequest must
be available on the PATH.
Your .DDF files and all data files must be in the current
working directory when BTVIEWER is started, or in a
directory pointed to by the BTFILEPATH environment
variable. For example, if you have your .DDF files in
C:\DDFS and your data files in C:\DAT and D:\MOREDAT, you
would insert the following line into your AUTOEXEC.BAT:
SET BTFILEPATH=C:\DDFS;C:\DAT;D:\MOREDAT;
IMPORTANT NOTE: Please begin working on the sample Btrieve
and .DDF files supplied with BTVIEWER. BTVIEWER is a
powerful tool, but like most power tools, can have
undesired effects on the new user.
A. Starting BTVIEWER
At any DOS prompt (or from the directory that
BTVIEWER files reside in, if not on your PATH)
type:
BTVIEWER<Press ENTER>
BTVIEWER will then take a few seconds to load.
Depending upon the settings on the "Set Misc.
Parameters" screen (under the "Options" menu)
BTVIEWER may also load Btrieve or Brequest. If you
get a message indicating that BTVIEWER is unable to
load Btrieve, load Btrieve from the command line
and then go to the "Set Misc. Parameters" screen
and ensure that the default Btrieve start up
parameters are set correctly.
Three command line parameters are possible.
/k:keyfile, where keyfile is the name of a file
with keystrokes for BTVIEWER to use on start-up.
See Appendix B for details on creation of a
keystroke file. /c:myfile.cf2 where myfile.cf2 is
a version of the BTVIEWER.CF2 configuration file
created under Options/Set Misc. Parameters. If
you need to, you can create 2 or more
configuration files, and with the /c command line
parameter, indicate which should be loaded. A third
possible command line argument is /v:vufile.vu where
vufile.vu is a "view" file that contains information
on a particular set of File, Field, Sort and
Restrictions. .VU files must be created within
BTVIEWER.
As BTVIEWER is loaded a screen will appear briefly
to list the registered owner of this copy of
BTVIEWER (Thank You!) or to remind you that you are
currently using an unregistered copy. This screen
will remain on the screen for a few seconds, and
then you may press any key to continue. Note that
the status line (the bottom line on the screen)
will almost always tell you what BTVIEWER is doing
or what you should do next.
B. The Main Menu
The Main Menu is a menu bar running across the top
of the screen. This menu has four options:
File, View, Options, and Help.
You can maneuver around the menu by using arrow
keys and the ENTER key, as well as ALT-Letter
combinations. (For instance, if no sub-menu is
"dropped," you may press the ALT and the H key to
get to the Help sub-menu.
To exit BTVIEWER, you can press ESC (or press ESC
twice if a sub-menu is "dropped") and you will
return to DOS. You may also exit by pressing ENTER
while the Exit option of the File sub-menu is
highlighted.
C. The File Sub-menu
The File sub-menu includes four options:
Browse/Edit Btrieve File, Clone Btrieve File, Pack
Btrieve File,and Exit.
1. Cloning a Btrieve file
With this option, you can make an empty copy
of an existing Btrieve file. You must enter
the name of the Btrieve file as well as the
name of the "clone" file to be created.
2. Packing a Btrieve file
Like most DOS files, Btrieve files get bigger
as records are added, but do not shrink as
records are deleted. This can be especially
noticeable if you have a transaction file
that grows and grows until some month or year
end procedure, and then is purged. The space
where the deleted records were is still in
the file. This space will eventually be used
again, but what if you can't wait?
That is where Packing comes in. Simply
supply the name of the file to be packed, and
BTVIEWER will rewrite it without the space
where the deleted records were. The original
file is saved with an extension of .BAK.
Please ensure that the packed file is good
and then you may delete the .BAK.
3. Copying a Btrieve file
This operation allows you to copy data from one
btrieve file to another, possibly with different
key structure and record length.
4. Rebuild a Btrieve file
This option allows you to rebuild a damaged file.
If you don't normally read
documentation, PLEASE READ THIS! This
is a "last resort" procedure that should
be used only if no recent backup exists.
While there is little chance of damage
occurring to your Btrieve file since the
original is opened in read-only mode,
and the original is saved as a .BAK
file, backups are the best bet! There
is no guarantee that this procedure will
get all records, although it is likely
that almost all records will be
recovered.
This procedure uses physical positioning
(not logical positioning, going through
the file via a key) to read from the
first physical record to the last. If
an error occurs while proceeding from
beginning to end, the program tries to
step directly to the last record, and
tries to read from end to beginning. If
there is only one record that has a
problem, all but that one record should
be recovered.
5. Misc. Btrieve Functions
a. Set Owner
Btrieve allows users to set "owners" for
files. By setting an "owner," a Btrieve
user can choose to allow no access to
the file without the owner name or allow
read-only access, and the user can
choose whether the file will be
encrypted or not. It is important to
remember that if you set an owner for a
Btrieve file, any program that is to
access it (including BTVIEWER) must know
that user name, and the user must
remember the user name if s/he wishes to
Clear the owner (see below).
When the File/Misc. Btrieve
Functions/Set Owner menu option is
selected, BTVIEWER displays a box with
three fields. In the first field, enter
the name of the file for which an owner
name is to be set. In the second field,
enter the string that will become the
new "owner." In the third field you
will be presented with a menu that will
allow you to choose whether or not to
allow read-only access without the owner
name, and whether or not the Btrieve
file should be encrypted. Highlight the
appropriate option and press ENTER. If
you have selected an option that calls
for encryption, some time may be
required. Please be patient.
b. Clear owner
When the File/Misc. Btrieve
Functions/Clear Owner menu option is
selected, BTVIEWER displays a box with
two fields. In the first field, enter
the name of the file for which an owner
name is to be cleared. In the second
field, enter the current "owner." If
you have selected a Btrieve file that
had an owner name set with encryption,
some time may be required. Please be
patient.
c. Statistics
When the File/Misc. Btrieve
Functions/Statistics menu option is
selected, BTVIEWER prompts for a file
name to be entered. If the file name
entered exists and is a valid Btrieve
file, BTVIEWER will display information
about the file, including the number of
records and number of keys, the record
length, the file length, and some
information on the actual space used, on
average, for each record in the file and
the % utilization. Information on the
keys will appear in a box on the lower
portion of the screen. If more keys
than will fit on one screen are present,
use the arrow or page down keys to see
the rest of the key information.
d. Btrieve Version
When the File/Misc. Btrieve
Functions/Btrieve Version menu option is
selected, BTVIEWER displays a small box
that gives Btrieve version information,
for instance "Btrieve Version 5.10 for
Networks." Press any key to continue.
e. Create file from BTB file
Select this option to create a new Btrieve file.
You will need to supply the name of a
BTrieve Build file (BTB) and a name for the
new file. This option is similar to BUTIL's
-CREATE option, but with much better error
handling. Please see the sample BTB file
called SAMPLE.BTB provided with BTVIEWER
system and listed in Appendix A.
f. Supplemental Index
Selecting this menu option will give you
another menu, where you may create or
drop a supplemental index. You must
have a .BTS file (see SAMPLE.BTS for a
sample of the format). Enter the .BTS
file name in the first field, and the
name of the Btrieve file to add the
supplemental index to in the next.
If you choose to drop a supplemental
index, you will be asked to supply the
Btrieve file name and the index number
to drop. Use File/Misc. Btrieve
Functions/Statistics to determine the
key number to drop.
g. Transactions
You may begin a transaction, or if one
is already in progress, end a
transaction using this menu option.
When ending a transaction, you may
choose to simply end the transaction
(changes saved) or you may abandon the
transaction (changes lost).
6. Exiting BTVIEWER
Choose this option to exit BTVIEWER and return
to DOS. You may also exit by pressing ESC
(or by pressing ESC twice if you are in the
File, Options, or Help sub-menu).
D. The View Sub-menu
The file sub-menu (explained previously) contains
many different utility functions, but the View
sub-menu is the heart of BTVIEWER and where you
will spend the bulk of your time using BTVIEWER.
Lets look at what you can do with BTVIEWER. Lets
say you are a purchasing manager at a retail
store. Vendor XYZ calls to tell you that there
has been an across the board price 5% increase on
their products. If you buy five or six items
from vendor XYZ, you can simply use your
application program and go into the items and
calculate the new cost. However, if you have
1000 items, this is hardly proctical.
This is where BTVIEWER can come in. After you
make sure the .DDF files and the data files are
in the current working directory or in a
directory in the BTFILEPATH environment variable,
you start BTVIEWER. You go to the View sub-menu,
and first choose the File option. You will be
presented with a list of files that are described
in your .DDF files. You select the ITEM file.
Next you choose the Field option of the View
sub-menu, then the Add Fields option. Here you
will be presented with a list of the fields in
your selected file (the ITEM file). Since you
need to restrict the view to vendor XYZ, you
select the Vendor field. Since you wish to
modify the Cost field, you select the Cost field.
As you add fields, they are listed to the right
of your screen.
You can now exit the Field selection screen by
pressing ESC. Now you need to limit your view to
items from vendor XYZ. Choose Restrict from the
View sub-menu, and then Add/Edit restrictions.
This brings you to a screen (or a series of
screens if you select many fields as part of your
view) that has the field names to the left and a
data entry field to the right. This is a "Query
by Form" screen that lets you set restrictions
on each field in the view. Since we wish to
restrict our view to items from vendor XYZ, we
move to the Vendor field and enter the following
text: ="XYZ" The quotes are not essential unless
leading or trailing blanks are significant.
We can now press F10 to indicate we are done with
setting restrictions. We should now display the
data before modifying it to ensure that we are
getting the result we expect. We could first go
to the Sort sub-menu and choose a sort that
begins with the Vendor field, since when the view
is sorted by a field with a restriction it will
generally result in better performance while
searching for records.
If the items we see in the view appear to be what
you wish to modify, you next select Modify All in
View from the View sub-menu, followed by Modify
all. You will be presented with a screen much
like the Query by Form screen described
previously, except that on this screen you enter
information on how the fields in the view should
be modified. Go to the Cost field and enter:
*1.05 This means "Multiply every cost field by
1.05" This will result in the cost field being
increased by 5%. If the retail price was also in
the view, at the same time we could have modified
it as well. On the other hand, we could have
just as easily said, "How dare XYZ raise prices
by 5%!" and decided to delete all XYZ products
from our item file by selecting the Delete All
option under Modify all in View.
There you have it. A quick look at what BTVIEWER
can do with "Views." Now for more specific
information on options:
1. File
This is pretty straigntforward. If BTVIEWER
cannot find the FILE.DDF file it will tell you
so. Otherwise a list of files will appear.
Select the file you wish to view.
2. Field
a. Add Fields
From the Fields listed, select any fields
you wish to see as part of your View.
Fields may be selected in any order and
will be displayed, left to right, in the
order you select.
The last option on the field selection menu
is "* Calculated *". Select this if you
want a calculated field added to your view.
You may use the +, -, * and / operators,
and operands can be fields in the file or
constant values. Calculations are done
left to right: That is, 1+2*3 would be 9,
not 6.
b. Delete Fields
If any fields are selected, you will be
able to delete them from the View.
c. Clear Fields
This option clears all fields from the
current View.
d. Define Summary
This option presents you with a menu of
fields currently in the View. Toggle
selection of fields by pressing ENTER when
the field is highlighted. Fields with a
check mark next to them when you exit the
menu by pressing <F10> will have summary
information printed about them.
Summary for numeric fields includes MIN, MAX,
SUM, AVG. Summary for string fields includes
MIN and MAX.
e. Print/Display Summary
This option reads through the current View
(which could be the entire file if no
restrictions are set) and displays the
resulting report, with an option to print
the report.
f. Joins
i. Set-up join
This option allows you to select a primary
field, a secondary file to join to, and an index
in the secondary file to cause the link to
occur. The join is much more relaxed that
joins in other programs. If the link is
plausable it is allowed. For instance, any
number field with 0 decimals can be linked
with any other number field with 0 decimals.
Follow the on-screen instructions. After a
successful join, add fields from the
secondary file.
ii. Clear join
This option clears all information about a
previously defined join.
3. Restrict
a. Add/Edit Restrictions
This Query by Form screen allows you to specify what
subset of records will be part of the current "view."
In the field to the right of each field name, you can
enter a line like the following:
Part Number: >2000_______________________________
In the example above, if the Part Number is a number
type (Decimal, Numeric, Integer, Float, Bfloat or
Unsigned) this will restrict the view to records
where the Part Number field evaluates to greater
than 2000. If Part Number is a string type (Zstring,
Lstring or String) records where the Part Number is
alphabetically greater than 2000. If trailing
spaces are significant in the value, enclose the
value in quotes.
The pattern is: <operator> <value> [and <value>] where
operator can be any of the following:
<>, !=, NOT EQUAL TO, NOT EQUALS, NOT EQUAL, NE
<=, LESS THAN OR EQUAL, LTE
<, LESS THAN, LT
>=, GREATER THAN OR EQUAL, GTE
>, GREATER THAN, GT
=, EQUAL TO, EQUALS, EQUAL, EQ
CONTAINS
DOES NOT CONTAIN, DOESN'T CONTAIN
ALL SPACES
NOT ALL SPACES
LIKE
NOT LIKE
BETWEEN
Most of the above are self explanatory, however, some
require explanation. CONTAINS, DOESN'T CONTAIN, LIKE,
NOT LIKE, ALL SPACES and NOT ALL SPACES only work with
String type fields, and are ignored for other types.
LIKE and NOT LIKE work by comparing strings with wild
carding similar to MS-DOS wild cards ('?' means any
character, '*' means anything to the right is OK). We
also allow '#' to mean any digit, and '~' to mean any
alphabetic character. BETWEEN is the only restriction
type that requires two values, separated by "AND".
NOT ALL SPACES and ALL SPACES take no arguments, and is
valid only for string type fields.
Also note that if you are doing a restrict on a large
file, it might pay to have one of your restricts on the
first field (segment) of the current sort, since this
will make things go LOTS faster.
b. Clear Restrictions
This option clears all restrictiond from
the current View.
4. Sort
You may select here one of the existing sorts
defined in the .DDF file, or a User-Defined sort.
If the User Defined sort is selected, the program
will pause to ask you if you want to build the
supplemental index. If you answer "Yes" the
program will build it, taking some period of time
dependent upon the size of the file and the
complexity of the sort requested. If you answer
"No" the user defined sort is abandoned.
When a user defined sort is in effect and you go
to exit the program or change files, BTVIEWER
will drop the supplemental index, which might
also take a little time, dependent upon the size
of the file.
5. Display/Edit
On this screen, records in the view are
displayed, one record per line. Use the arrow
keys to move around. To Edit, Hex edit, Delete
or Add a record, press ENTER when the record in
question is highlighted.
6. Print
This produces a simple listing of the view.
7. Import/Export
a. Import View
You must supply the name of an
comma-delimited ASCII file. It must
have the fields in the same order as the
current View.
b. Export View
i. Comma-delimited ASCII
You supply the name of an ASCII file to
be produced. The fields in the
resulting file will be in the same order
as the fields are defined in the view.
ii. dBASE III format.
You supply the name of a dBASE III file to
be produced. The fields in the
resulting file will be in the same order
as the fields are defined in the view. If
the file exists, it MUST contain fields just
like in the view.
8. Modify All in View
a. Modify All
This Modify by Example screen allows you to specify
how to modify the records in the current view. In
the field to the right of each field name, you can
enter a line like the following:
Unit Retail: *1.05__________________________
In the example above, if the Unit Retail is a number
type (Decimal, Numeric, Integer, Float, Bfloat or
Unsigned) this will multiply each Unit Retail in the
view by 1.05, in this case increasing the unit
retail by 5%. If Unit Retail is a string type the
above line will have no effect! The only allowed
operator for strings is '=' which simply sets the
string to that which is to the right of the equal
sign, ignoring leading and trailing spaces not
enclosed in quotes.
The general pattern is <operator> <value>
[with <value>] where <operator> is one of the
following:
+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
= (Assignment or equals)
REPLACE
<value> can be a literal (like "1.23") or
a field name.
'REPLACE' is used in a line as follows:
REPLACE "Bob" with "Robert"
'REPLACE' is case sensitive (one of the only
commands that is).
It is probably a good idea to Display the current
view before doing a batch modify to ensure you have
phrased your restrictions properly. In addition, be
aware of some subtle problems. If, for example, your
restriction is something like "Unit Retail > 9.99"
and your view sorts on Unit Retail, and your Modify
by Example specifies "Unit Retail *1.2", be aware that
those Unit Retails will be modified in a loop that
will make the data worthless. Since you are
modifying Unit Retail, when you hit the first unit
retail for lets say 10.00, when it is reinserted as
12.00, it will change places in the sort, since you
are sorting on Unit Retail, and it will be modified
again, and again, and again...
If you do not understand the implications of the
above example, just make sure that any modification
you do don't involve the primary key in your view.
b. Delete All
This option deletes all recodrs in the
current View. BE SURE THIS IS WHAT YOU
WANT TO DO BY DISPLAYING THE VIEW FIRST!
9. Save/Load View
A "view" consists of a file, some fields, information
on a JOIN if any, restrictions and a sort order. A
good convention would be to name all view files with a
.VU extension.
a. Save current View
b. Load View
E. The Options Sub-menu
1. Set Colors
Choose from the four color sets mentioned.
2. Set Misc. Parameters
Choose this option and you will be presented
with a screen that looks like this:
Set BTVIEWER Misc. Options
[_] Load Btrieve?
[_] Load Brequest?
Browse/Edit Open Mode: ___________
Btrieve load options: ________________________
Brequest load options: ________________________
Memory to save for Btrieve: ______
Owner name for Btrieve: ____________________
Largest variable record: _____
Print report to (LPT1, etc): ________________________
Default File Name Mask: _____________________________
(i.e. "*.DAT")
The first two questions ask if you would like
to load Btrieve and/or Brequest. It might be
better (from a memory control standpoint) to
have Btrieve loaded BEFORE you run BTVIEWER,
but it is often convenient to allow BTVIEWER
to load it for you.
The next question allows you to determine the
open mode when files are browsed or edited
(using the File/Browse-Edit Btrieve File menu
option). If you wish to ensure that the file
is not changed, set Read-Only. If working on
a network, and you wish to have exclusive
access to a file, set Exclusive. To verify
data as it is written (normally not needed
and not very effective in any case) set
Verify. If you are working on a file where
you are starting fresh and have nothing to
lose, you may want to set Accelerated. Note
that Accelerated has no effect on speed of
reading the file, and will leave your file
damaged if it is not closed properly. This
option is included for completeness, not
because we recommend this option. All
options are presented to you on a menu.
The next two questions allow you to specify
Btrieve and/or Brequest start-up (load)
options. Please see your Btrieve or Brequest
manual for specifics. Also, note that it is
possible to give invalid load options to
Btrieve that will prevent Btrieve from being
loaded. In that case, load Btrieve BEFORE
you enter BTVIEWER and then correct the
Btrieve load options.
The amount of memory to save for Btrieve is
dependent upon the version of Btrieve you are
using, the load options you specify, and the
availability of extended (or is that
expanded...) memory. Run Btrieve with the
load parameters you expect to use and then
run AMIMAP.EXE (a utility that reports on the
space taken up by resident programs) and note
how much space is taken up by Btrieve. Add
several thousand bytes to this for good luck,
and this will reserve enough memory for
Btrieve. 130000 is a safe number to use if
this is too much for you to figure out.
Owner name is the owner name to use when
opening up Btrieve files that require an
owner name. If you don't know what this
means, you probably don't need to fill this
in.
Largest variable record is important if you
are going to read variable length record
Btrieve files. If you have too small a
number here, you might get an error 22
(buffer too short). If you have too large a
number here, you may have memory problems.
Print report to specifies where reports
(currently only the registration form and printing
this documentation) should print. This should
almost always be LPT1 or PRN. Try those if
in doubt.
The default file mask allows you to set the
default file mask without having to enter it
on the command line each time. The default
is "*.DAT", but for many "*.BTR" is more
convenient.
3. Reset Btrieve
Issues a RESET command to Btreive. Closes any open
files.
4. REGISTER BTVIEWER
If you like what you see, and would like to
make sure that shareware programs like
BTVIEWER are produced, you must
register and pay for the use of the program.
The $79.00 requested (for a single user copy)
is a steal, and to further entice you, we even
made up this neat utility to print out the
registration form for you. Simply fill in
the requested information and the form will
be printed. Fill in the number of single
user or site licenses, the size disks you
wish to receive, and mail it to the address on
the form. You can always just jot down your
name and address and mail that in with a
notation that you are registering for
BTVIEWER, but what the heck, that's what
computers are for!
Another registration option for CompuServe
subscribers is to use the new CIS Shareware
Registration service. Expected to be available
in July, 1992, type GO SWREG at any '!' prompt.
Registrations are billed directly to your CIS
account. This is ideal for international users
of CompuServe. BTVIEWER's Registration ID is
135. BTFILER'S Registration ID is 1.
If you register, you will get:
A copy of the latest version of the
BTVIEWER system.
A printed manual.
Notice of future upgrades.
Information on future products.
Support for a MINIMUM of 90 days.
A copy of our BU partial BUTIL
replacement program.
This program STOPs, RESETs Btrieve,
shows BTRIEVE version and CLONEs
Btrieve files. You may distribute
this freely.
E. The Help Sub-menu
These options are self explanatory (and non-
threatening if you just try them out).
1. List Error Codes
2. List Operation Codes
3. Page Size Calculator - For the designer of Btrieve
file databases, allows for the creation of files
with the minimum amout of space wasted.
3. About BTVIEWER
5. Getting help/making suggestions/future directions
If you are a registered user, or if you are having a
problem getting started, PLEASE contact us at:
Access Microsystems Inc.
404 Midstreams Road
Brick, NJ 08724-3838
(908) 892-2683
CIS: 74040,607
We generally work 9 to 5, Monday through Friday. We
may not always be here when you call, but we will try
to return calls if you leave a SPECIFIC message. We
monitor Compuserve (CIS) messages daily for support
purposes, but understand that not everyone is ready for
E-Mail.
We seek your advice on future directions for this and
other products. We expect (if the interest in BVIEWER
warrants) a follow-on product that will add some additional
features.
APPENDIX A - Listing of SAMPLE.BTB
The following is a listing of SAMPLE.BTB, An ASCII file that
describes a BTRIEVE file to be built with BTVIEWER's
File/Misc. Btrieve Functions/Create File from BTB file menu
option. Please modify this file to create the type of file
YOU need. Keep the BTB file you create on line to rebuild
the file you create as needed.
#
# This line (and all lines beginning with '#') are COMMENTS.
#
# This is a sample BTrieve Build (BTB) file. It allows for the
# creation of Btrieve files in BTFILER. It does the same thing
# as the BUTIL -CREATE function, but with one significant
# difference: Error diagnostics are clearer. This removes (I
# think) the most significant problem with the BUTIL -CREATE
# process. Someday an interactive create utility will be part
# of BTFILER, but until then, this will have to do...
#
# Case is not important, and some fields are optional (as
# noted in comments).
#
# These are the fields possible listed in order of appearance
# in the file level settings section:
#
# RECORD LEN=n
# PAGE SIZE=n, multiple of 512
# VARIABLE=<YES or NO>
# BLANK TRUNCATION=<YES or NO> OPTIONAL!
# DATA COMPRESSION=<YES or NO>
# FREE SPACE THRESHOLD=<10, 20 or 30>
# ALTERNATE FILE=<filename> OPTIONAL if no alternate key
# INCLUDE DATA=<YES or NO> OPTIONAL!
# NUMBER OF KEYS=n
#
#
# These are file level settings, with more details...
#
RECORD LEN=131
#
# In the Help menu, see "Calculate Page Size" to find optimal size.
#
PAGE SIZE=1536
VARIABLE=NO
#
# BLANK TRUNCATION is only meaningful with variable length
# records, so this BLANK TRUNCATION= line is optional.
#
BLANK TRUNCATION=NO
DATA COMPRESSION=NO
#
# FREE SPACE THRESHOLD=n, where 'n' is 10, 20 or 30 ONLY!
#
FREE SPACE THRESHOLD=20
#
# ALTERNATE FILE=fname, where fname is the name of a file like
# UPPER.ALT. This line is optional IF no ALTERNATE=YES
# key segments exist.
#
ALTERNATE FILE=UPPER.ALT
#
# INCLUDE DATA=<Y or N> is used to determine if the file is key only
# Data only, or key and data. INCLUDE DATA= line is OPTIONAL!
#
# For KEY ONLY: INCLUDE DATA=NO
# NUMBER OF KEYS=1
# and key length is == to record length.
#
# For DATA ONLY: INCLUDE DATA=YES
# NUMBER OF KEYS=0
#
INCLUDE DATA=Yes
#
# NUMBER OF KEYS= is used as a cross check of the segments
# passed below. In case of a conflict, the option is given
# to accept the key count reflected in the segments, or
# abandoning creation of the file.
#
NUMBER OF KEYS=2
#
# END OF FILE LEVEL SETTINGS!
#
# This marks the beginning of key segment level information.
# If I were you, and I were creating BTB files, I would
# place a large comment band between each key segment
# to remind myself what I think I am doing. Just a
# thought...
#
# The lines for each key segment are in the following order:
#
# START=n, where 'n' is the starting position of the key
# LEN=n, where 'n' is the length of the key
# MODIFIABLE=s, where 's' is Y or N (or YES or NO or Yes or...)
# Allows Modifications to be made to the key?
# DUPLICATES=s, ditto above...Allows Duplicate keys?
# ALTERNATE=s, where 's' is as above. Alternate Collating Sequence?
# DESCENDING=s, like above. Sorts Hi to Lo?
# TYPE=t, where 't' is EXACTLY one (case difference OK) of the following:
#
# "String",
# "Integer",
# "Float",
# "Date",
# "Time",
# "Decimal",
# "Money",
# "Logical",
# "Numeric",
# "Bfloat",
# "Lstring",
# "Zstring",
# "Unsigned Binary",
# "Autoincrement",
#
# NULL=n, where 'n' is the decimal NULL value (commonly 0 or 32) OR
# NULL=N/A to explicitly state no NULL value.
# NULL= is OPTIONAL.
# SEGMENT=s, where 's' is Y or N (or Yes or N0...). The number of
# segments with a SEGMENT=No value should be the same
# as the number of keys you declare.
#
#
# Key 0/Segment 1
#
START=1
LEN=11
MODIFIABLE=n
DUPLICATES=n
ALTERNATE=n
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=NO
#
# key 1/segment 1
#
START=12
LEN=30
MODIFIABLE=y
DUPLICATES=y
ALTERNATE=y
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=YES
#
# key 1/segment 2
#
START=1
LEN=11
MODIFIABLE=y
DUPLICATES=y
ALTERNATE=y
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=NO
#
# That's all, folks!
#
Appendix A - Listing of SAMPLE.BTB and SAMPLE.BTS
Use the following file (supplied on disk as well) that
allows you to create a Btrieve file by describing it in an
ASCII file. Modify it for your needs and run the
File/Misc. Btrieve Functions/Create file using BTB file menu
option. When asked, supply the name of the BTB file you
have modified for your use, or use the SAMPLE.BTB file to
see how the system works.
#
# This line (and all lines beginning with '#') are COMMENTS.
#
# This is a sample BTrieve Build (BTB) file. It allows for the
# creation of Btrieve files in BTVIEWER. It does the same thing
# as the BUTIL -CREATE function, but with one significant
# difference: Error diagnostics are clearer. This removes (I
# think) the most significant problem with the BUTIL - CREATE
# process. Someday an interactive create utility will be part
# of BTVIEWER, but until then, this will have to do...
#
# Case is not important, and some fields are optional (as
# noted in comments).
#
# These are the fields possible listed in order of appearance
# in the file level settings section:
#
# RECORD LEN=n
# PAGE SIZE=n, multiple of 512
# VARIABLE=<YES or NO>
# BLANK TRUNCATION=<YES or NO> OPTIONAL!
# DATA COMPRESSION=<YES or NO>
# FREE SPACE THRESHOLD=<10, 20 or 30>
# ALTERNATE FILE=<filename> OPTIONAL if no alternate key
# INCLUDE DATA=<YES or NO> OPTIONAL!
# NUMBER OF KEYS=n
#
#
# These are file level settings, with more details...
#
RECORD LEN=131
#
# In the Help menu, see "Calculate Page Size" to find
optimal size.
#
PAGE SIZE=1536
VARIABLE=NO
#
# BLANK TRUNCATION is only meaningful with variable length
# records, so this BLANK TRUNCATION= line is optional.
#
BLANK TRUNCATION=NO
DATA COMPRESSION=NO
#
# FREE SPACE THRESHOLD=n, where 'n' is 10, 20 or 30 ONLY!
#
FREE SPACE THRESHOLD=20
#
# ALTERNATE FILE=fname, where fname is the name of a file like
# UPPER.ALT. This line is optional IF no ALTERNATE=YES
# key segments exist.
#
ALTERNATE FILE=UPPER.ALT
#
# INCLUDE DATA=<Y or N> is used to determine if the file is key only
# Data only, or key and data. INCLUDE DATA= line is OPTIONAL!
#
# For KEY ONLY: INCLUDE DATA=NO
# NUMBER OF
KEYS=1
# and key length is == to record length. #
# For DATA ONLY: INCLUDE
DATA=YES
# NUMBER OF KEYS=0
#
INCLUDE DATA=Yes
#
# NUMBER OF KEYS= is used as a cross check of the segments
# passed below. In case of a conflict, the option is given
# to accept the key count reflected in the segments, or
# abandoning creation of the file.
#
NUMBER OF KEYS=2
#
# END OF FILE LEVEL SETTINGS!
#
# This marks the beginning of key segment level information.
# If I were you, and I were creating BTB files, I would
# place a large comment band between each key segment
# to remind myself what I think I am doing. Just a
# thought...
#
# The lines for each key segment are in the following order:
#
# START=n, where 'n' is the starting position of the key
# LEN=n, where 'n' is the length of the key
# MODIFIABLE=s, where 's' is Y or N (or YES or NO or Yes or...)
# Allows Modifications to be made to the key?
# DUPLICATES=s, ditto above...Allows Duplicate keys?
# ALTERNATE=s, where 's' is as above. Alternate Collating Sequence?
# DESCENDING=s, like above. Sorts Hi to Lo?
# MANUAL=s, like above. Manual key? OPTIONAL!
# TYPE=t, where 't' is EXACTLY one (case difference OK) of the
# following:
#
# "String",
# "Integer",
# "Float",
# "Date",
# "Time",
# "Decimal",
# "Money",
# "Logical",
# "Numeric",
# "Bfloat",
# "Lstring",
# "Zstring",
# "Unsigned Binary",
# "Autoincrement",
#
# NULL=n, where 'n' is the decimal NULL value (commonly 0 or 32) OR
# NULL=N/A to explicitly state no NULL value.
# NULL= is OPTIONAL.
# SEGMENT=s, where 's' is Y or N (or Yes or N0...). The number of
# segments with a SEGMENT=No value should be the same
# as the number of keys you declare.
#
#
# Key 0/Segment 1
#
START=1
LEN=11
MODIFIABLE=n
DUPLICATES=n
ALTERNATE=n
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=NO
#
# key 1/segment 1
#
START=12
LEN=30
MODIFIABLE=y
DUPLICATES=y
ALTERNATE=y
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=YES
#
# key 1/segment 2
#
START=1
LEN=11
MODIFIABLE=y
DUPLICATES=y
ALTERNATE=y
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=NO
#
# That's all, folks!
#
Use the following file (supplied on disk as well) that
allows you to create a Supplemental Index for a Btrieve file
by describing it in an ASCII file. Modify it for your needs
and run the File/Misc. Btrieve Functions/Supplemental
Index/Create menu option. When asked, supply the name of
the BTS file you have modified for your use, or use the
SAMPLE.BTS file to see how the system works.
#
# This line (and all lines beginning with '#') are COMMENTS.
#
# This is a sample BTrieve Supplemental Index (BTS) file.
# It allows for the creation of a supplemental index (key)
# for Btrieve files in BTVIEWER. It does the same thing
# as the BUTIL -SINDEX function, but with one significant
# difference: Error diagnostics are clearer. This removes (I
# think) the most significant problem with the BUTIL - SINDEX
# process. Someday an interactive utility for this will be part
# of BTVIEWER, but until then, this will have to do...
#
# Case is not important, and some fields are optional (as
# noted in comments).
#
# This field is the only field possible on the file level section:
#
# ALTERNATE FILE=<filename> OPTIONAL if no alternate key
#
#
#
# ALTERNATE FILE=fname, where fname is the name of a file like
# UPPER.ALT. This line is optional IF no ALTERNATE=YES
# key segments exist.
#
ALTERNATE FILE=UPPER.ALT
#
# END OF FILE LEVEL SETTINGS!
#
# This marks the beginning of key segment level information.
# If I were you, and I were creating BTS files, I would
# place a large comment band between each key segment
# to remind myself what I think I am doing. Just a
# thought...
#
# The lines for each key segment are in the following order:
#
# START=n, where 'n' is the starting position of the key
# LEN=n, where 'n' is the length of the key
# MODIFIABLE=s, where 's' is Y or N (or YES or NO or Yes or...)
# Allows Modifications to be made to the key?
# DUPLICATES=s, ditto above...Allows Duplicate keys?
# ALTERNATE=s, where 's' is as above. Alternate Collating Sequence?
# DESCENDING=s, like above. Sorts Hi to Lo?
# MANUAL=s, like above, Manual key? OPTIONAL!
# TYPE=t, where 't' is EXACTLY one (case difference OK) of the following:
#
# "String",
# "Integer",
# "Float",
# "Date",
# "Time",
# "Decimal",
# "Money",
# "Logical",
# "Numeric",
# "Bfloat",
# "Lstring",
# "Zstring",
# "Unsigned Binary",
# "Autoincrement",
#
# NULL=n, where 'n' is the decimal NULL value (commonly 0 or 32) OR
# NULL=N/A to explicitly state no NULL value.
# NULL= is OPTIONAL.
# SEGMENT=s, where 's' is Y or N (or Yes or N0...). The number of
# segments with a SEGMENT=No value MUST be one in this case
# since only a single supplemental index can be declared
# at once.
#
# Segment 1
#
START=1
LEN=22
MODIFIABLE=n
DUPLICATES=n
ALTERNATE=n
DESCENDING=n
TYPE=STRING
NULL=N/A
SEGMENT=NO
#
# That's all, folks!
#
Appendix B - Using Keystroke files
BTVIEWER allows for use of keystroke files to automate some
program functions. What must be in the file is every
keystroke that is required to run a particular operation.
The only exception is the keystroke required to bypass the
registration reminder screen. This screen is passed over
if a keystroke file is being played.
Most characters are self explanatory, but some special
characters may also be entered. '!' is used where an enter
key would be played, and '#' substitutes for ESC. Control
characters may be entered as the caret key ('^') followed by
the actual letter (i.e. 'C'). If the characters '^' 'C' are in
a keystroke file, and they are played back while in a data
entry field, they will clear the field. Function keys may be
entered by preceding the two digit function key number with a
tilde ('~'). F10 is ~10. It is easiest to use the mnemonic
characters (those highlighted on the menus) to select options,
and note currently there is a limit of 200 characters that may
be played back. Below two batch files are listed that create
keystroke files on the fly and then feed them to BTVIEWER.
BTCLONE.BAT
echo off
if '%1' == '' goto NO_PARMS
if '%2' == '' goto NO_PARMS
goto OK
:NO_PARMS
echo USAGE: BTCLONE existing_file new_clone_file
goto END
:OK
rem
rem 'C' to choose Clone on opening menu, %1 the Btrieve
file, '!' for ENTER,
rem %2 the New file, '!' for enter, and '###' for ESC's.
rem
echo C%1!%2!### >btclone.txt
btviewer /k:btclone.txt
del btclone.txt
:END