Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : TN9101.ZIP
Filename : DOSUTILS.TXT

 
Output of file : DOSUTILS.TXT contained in archive : TN9101.ZIP

This article is reprinted from the January 1991 edition of
TechNotes/dBASE IV. Due to the limitations of this media, certain
graphic elements such as screen shots, illustrations and some tables
have been omitted. Where possible, reference to such items has been
deleted. As a result, continuity may be compromised.

TechNotes is a monthly publication from the Ashton-Tate Software
Support Center. For subscription information, call 800-545-9364.

DOS Utilities
Joe Stolz
Remember the scene in The Wizard of Oz when Dorothy and her friends
sat quaking in front of the spector whose booming voice echoed "I am
the Great and Powerful Oz!". It took little Toto to figure out that
there was something going on behind the scenes. A little tug on a
curtain and suddenly the frightening sight was minimized to something
harmless and contrived.

I find that to be a good metaphor as to how some new users regard the
Control Center and its many hidden passageways. As a result, many of
the fine features of dBASE IV have gone un-noticed by some users of
the product. With so many features and so much functionality, it may
take a while to discover some of the less obvious pathways down which
you may travel. But there is no need to venture with any trepidation.

Rather, in the spirit of exploration, I'd like to take you on a tour
of possibly unexplored territory in dBASE IV. Yes, you can bring Toto
too.

Located in the Tools menu, the DOS utilities are a set of functions
that are provided for the dBASE IV user, much like the utilities that
DOS filer type programs such as XTREE provide. These utilities in
dBASE IV are not comparable to those provided in a dedicated filer
program, but they should not be disregarded as useless or
impractical. As a sort of impetus to you to consider the filer
capabilities provided through the DOS utilities, consider the fact
that dBASE IV has a very large number of support files, occuping over
3MB of disk space! Further, you have database files, format files,
report files, and so forth. Often, each category of file has
supplemental parts such as indexes, memo files, object files and code
files. With so many files to keep track of, it is important to be
able to view files, delete files that no longer appear to be useful,
and to copy, move and rename important files. All these options are
available in the DOS utilities menu.

General Operations

As I mentioned above, with so many files to keep track of, you can't
help but need some means of viewing them and evaluating them.
Furthermore, if you are like me, you can never find enough free hard
disk space. I find myself eliminating old working copies of files and
backup copies of others on nearly a daily basis.

Several of the menus in DOS utilities provide a straight forward means
of setting up the utilities environment so that you can do your work.
In order to view whatever files you are concerned with, you will need
to locate them first. Since most people organize their hard disk into
tree-like subdirectories, you will need to view the files in the
particular subdirectory about which you are concerned. The second
menu, the Files menu, offers a means to change the display of files
shown in the center of the screen. This menu and the ones following
it from left to right, the Sort, Mark and Operations menus, have an
effect on the file listing that takes up the majority of the DOS
utilities screen. You should take note of the interrelation between
the Files menus and the other "operation oriented" menus because it
can become confusing as to which menu has an effect on the DOS
utilities, the Files menu or the first menu, the DOS menu.

DOS Access

The DOS menu, first on the left, only gives DOS functionality. It
gives DOS access to run DOS commands and also allows you to set the
default DOS directory into which dBASE will be "logged". In version
1.0, this was the only simple way to log into a new DOS subdirectory.
dBASE IV version 1.1 now provides the command SET DIRECTORY TO which
provides the same capability at the dot prompt.

If you start up dBASE IV in the dBASE home directory (where all the
dBASE program and support files are installed) you might want to move
to your data directory. You can do this from the Tools menu by
choosing the DOS menu option "Set default drive and directory". By
doing so, all files created henceforth will be created in the newly
set default directory.

However, this setting will have no effect on the directory listing in
the utilities screen! Its effect is to determine where files will be
read from and written to in Control Center activities.
On the other hand, you can use the Files menu to display all the files
in a particular directory. This menu also offers the use of wildcard
characters to restrict the view of files to, for example, only those
having a common file extension, or something else in common between
your file names. You can adjust the way that you view your hard disk
directory structure with the F9 key. When you select Files: Change
drive/directory, you can also choose the desired directory from a tree
diagram of your hard disk by pressing Shift-F1 after pressing Enter.
The results appear like the screen shot in Figure 1.

You can also switch your view to another directory using the F9 key
which displays a tree diagram of your hard disk structure. This tree
structure is probably familiar to most DOS users. When you press F9
in DOS utilities, you can see all your subdirectories branching from
the root directory of your hard disk. The current directory is
highlighted, and an arrow points to the current default directory.
Using the arrow keys you can traverse your directory structure but the
arrow head remains pointed at the current default directory. When you
press Enter, you will reset your default directory. At this point the
arrow head moves to the new directory, but the screen automatically
reverts to the original file display format, showing all files in the
new default directory. This effectively does the same thing as
changing the drive and directory that effect the display of files in
the Files menu.

Note that at the top of the tree structure, the current drive is
listed. You can change drives by highlighting the drive letter and
pressing Enter. When you do, a popup listing of drives will display
and allow you to cursor to, and select any drive.

There is yet another way to traverse your directories. When you look
at the listing of files in the middle of your screen, you will also
see subdirectories listed with angle brackets around them. If you
highlight these directories and press Enter, you will move up or down
the directory tree. The directories labeled are one level up
from the current directory. This method is most effective if you plan
to move just one directory up or down. It becomes slow and tedious to
move farther with any other method than the F9 one described above
since the full directory must be displayed each time that a selection
is made.

The most commonly performed file operations are simple to perform
using menu options once you have navigated to the proper directory.
Viewing, editing, marking and deleting files through the Operations
menu are realtively straight forward and don't require elaboration
here. Instead, I'd like to move on to some of the less obvious, but
very useful features found in DOS utilities.

Copying Using Shift-F1

You may often find that it takes quite a while to locate the
particular file that you want to copy. Perhaps you had to view
several files before you were sure which was the correct one. When
you finally found the one that you wanted, perhaps you want to quickly
copy it without loosing your train of thought. There are two ways to
do this. One way is leave the cursor on the file and choose the menu
option Operations:Copy. The other way is to press F8 while
highlighting the file. In either case, you are prompted to supply the
target file's directory and name. See Figure 2.

When you see this special screen it may not be very easy for you to
remember the exact name of the target directory for the file. It
would be very useful to see a listing of all the directories on a
given disk drive. Of course, you can do this easily with the
Shift-F1 keystroke. Shift-F1 throughout dBASE IV supplies you with a
list relevant to the operation you are performing. Here, Shift-F1
displays the same tree view of your disk directories that F9 supplies
you when you are in directory view. Here you can navigate to the
proper target directory and choose Enter, allowing dBASE IV to place
the correct directory name in the target directory slot. It want to
point out this feature since it isn't documented well in Using the
Menu System and the keystroke isn't shown on the navigation line
either! I only found out about this capability by viewing the Help
screens (by pressing the F1 key) while within DOS utilities.

F7, F8, and Del Keys

Another series of keystrokes that are not well known are the keys to
perform single-file copy, move and delete operations. Again, these
keys are well known in dBASE IV itself, but they are not well
documented as being functional in the DOS utilities area. Of course,
the keys are F8 (Copy), F7 (Move) and Del (to delete files). These
keys are mentioned in the Help screens. Also, the Operations menu
offers these functions, but with the added ability of allowing the
operation to apply to the current file, the group of marked files in
the file display, or the unmarked group. If you are going to copy
just one file, F8 is a much simpler and efficient way to do it, rather
than through the menu choice.

Files are marked by simply pressing the Enter key. When you do this,
an arrow denotes the file as tagged. One or more files can be
tagged. You can also tag all files, then untag those that you don't
want to work with, or reverse tag using the Mark menu. Pressing Enter
a second time on a marked file removes the tag.

The Del key works here just like it does in the Control Center.
Pressing the Del key allows you to delete the currently highlighted
file. Again, the Operations menu can be used to delete the current
file, tag or untag files.

But Wait, There's More!

There is another undocumented feature within the DOS Utilities that is
useful. For those of you who are familiar with Framework III, when in
Framework's file cabinet, if you want to set a particular directory as
the current default directory, you press Ctrl-Enter while highlighting
that directory name. Ctrl-Enter is the global keystroke to "save"
things in Framework III. It's not that strange that the keystroke
would have made its way into dBASE IV either. However, none of the
dBASE IV documentation discusses this keystroke, nor where it has an
effect.

Being an adventurous fellow, I went ahead and pressed Ctrl-Enter
within the DOS Utilities menu. When I highlighted a file name in the
file listing after coming into the Utilities, there was no effect.

When I highlighted the name of the samples subdirectory (located as a
child directory below my dBASE IV directory) I saw the hard disk light
flash. Examining the status bar, I saw that the dBASE IV directory
remained displayed there. Opening the Files menu I saw that the dBASE
IV directory remained there. This made sense to me since, as I
mentioned above, the Files menu "Change drive/directory" option
reflects the currently displayed files in the main Utilities screen.
As an added benefit, the status bar displays the same directory name,
as well as the top bar of the file display "popup".

So what did Ctrl-Enter do? When I looked in the DOS menu I saw that
the default DOS directory had been reset! It certainly is easier to
press Ctrl-Enter on a directory name than to open up a menu and type
in the proper directory name.

So now we have two non-menu ways to effect the file display and the
default DOS directory setting. If you want to display the files from
another directory, you can navigate there by pressing Enter on
to move to a higher directory in the tree, or pressing Enter
on a displayed directory name to display files in the lower
directory. You can press Ctrl-Enter while highlighting a directory
name and make that directory the default DOS directory, into which all
new files will be created.

One sour note in the Ctrl-Home feature is that if you press Ctrl-Home
on the directory entry, the word "parent" including the angle
brackets will be written into DOS: Set default drive and directory.
It won't work if you try to set this through the menu option, but that
parent directory will become the DOS default nonetheless. A small
price to pay for an undocumented feature!

Summary

The Tools provided in dBASE IV are remarkable given that they are only
ancillary utilities provided in a database program. It's rather a
pleasant surprise to find a file manager built-in to dBASE IV. Take a
look at the system provided the next time you are in dBASE IV. You
will find a lot of great and powerful functionality behind the
scenes. Only, there's no little round man turning cranks and pressing
buttons in our software making the special effects. Maybe in the next
version.




  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : TN9101.ZIP
Filename : DOSUTILS.TXT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/