home *** CD-ROM | disk | FTP | other *** search
- FM.DOC
- Printed: 03-04-1988 Page: 1
-
- Program: FM (FileManager)
- Author: Jim Zwick
- 51-C Cottage Street
- New Hartford, CT 06057
- Version: 1.0
- Date: 03-04-88
-
-
- OVERVIEW
-
- FM facilitates DOS file-handling procedures by providing a visual
- display of a directory's files and allowing files to be copied, moved,
- renamed, erased, printed and viewed by highlighting the files on the
- display and picking commands from a menu. Files can be spooled for
- printing using the DOS 3.xx Print Spooler from within FM. The program
- also displays the current spool and provides options to cancel printing
- of either selected files or the whole queue. On-line help is available
- by pressing <F1> from either the main File Manager or Spool Control
- menus.
-
-
- GENERAL OPERATION
-
- To start the program enter FM at the DOS prompt. FM will store the
- start-up screen and display a full-screen list of the files in the
- current directory, the number of files, and the amount of free disk
- space. The files will be displayed in alphabetical order with the
- first file in the list highlighted in reverse video. The following
- command menu will be displayed near the bottom of the screen:
-
- mArk Copy Move Erase Rename View Print Spec Dir dOs
-
- To issue a command, type the capitalized letter in the desired command
- name. The following is a full list of the commands available from this
- menu:
-
- mArk - Mark current file to be copied, moved or erased.
-
- Copy - Copy marked file(s) from current directory to another
- directory or drive.
-
- Move - Move marked file(s) from the current directory to another
- directory. Note that you cannot move files from one drive
- to another -- you can only move them between directories on
- the same disk.
-
- Erase - Erase marked file(s) from the current directory.
-
- Rename - Rename the currently highlighted file.
-
- View - View the currently highlighted text file.
-
- Print - Display DOS 3.xx print queue and access spool control
- options.
-
- <Alt>-P - Submit the currently highlighted file to the print queue.
-
- FM.DOC
- Printed: 03-04-1988 Page: 2
-
- Spec - Change the file specification used in the directory display
- (this works like the DOS DIR command and wildcard
- characters can be used).
-
- Dir - Change directories.
-
- dOs - Exit temporarily to DOS.
-
- <Esc> - EXIT from program.
-
- <F1> - Display a help screen listing these commands and
- descriptions.
-
- The arrow keys can be used to move around within the display and <PgUp>
- and <PgDn> can be used to move between screens when more than eighty
- files are in a directory. The currently highlighted file will be
- displayed in reverse video, as will all marked files. The current file
- will also have a blinking cursor under the first letter in its name so
- that it can be distinguished from marked files.
-
- Using <PgUp> or <PgDn> to move between screens does not remove marks from
- files. If you are in a directory with a lot of files, you can mark all
- that you want in the first 80 files, move to the next screen(s) using
- <PgDn>, mark still more files, and copy, move or erase them all at once.
-
- The dOs command allows you to exit temporarily to DOS. When you enter
- this command the message 'Type EXIT to return to File Manager ...' will
- be displayed on the screen and a new copy of DOS will be loaded into
- memory. You can do almost anything you want, including changing
- directories and running other programs, before you return to FM. You
- should keep in mind, however, that both FM and this second copy of DOS
- are stored in memory, substantially reducing the memory available for
- running other programs. Be careful to return to FM and finally
- exit from it using <Esc>.
-
- The print spooling commands are only available when you run the program
- under DOS 3.xx and have installed the print spooler before starting FM.
- If the commands are not available the Print option in the main menu line
- will not be highlighted (the capitalized letter will not be displayed in
- bold video) and nothing will happen if you press P or <Alt>-P. When
- the spooler is available the following spool control options are
- available:
-
- Pressing <Alt>-P sends the current file to the print spooler. Note
- that the program does not check the file to see if it is a text file
- so it is a good idea to double-check the file extension of the file
- you are submitting to the spool.
-
- Pressing P from the main FM menu will display the Spool Control window.
- It will list any files currently in the print spool and the following
- command menu will be displayed at the bottom of the screen:
-
- Print Cancel File Cancel All
-
- In addition to these commands, pressing <F1> will display a brief help
- screen with descriptions of the commands and their use, and <Esc> will
- return you to the main FM window.
-
- FM.DOC
- Printed: 03-04-1988 Page: 3
-
- The options in the Spool Control menu have the following functions:
-
- Print - Allows you to enter the file name of a file to print.
- You can add a file you don't see on the queue or another
- copy of a file already on it. This option will prompt
- you for a file specification of the file you want to
- print. Because you can enter a full file specification,
- the file can be on any drive or in any directory.
-
- Cancel File - Allows you to selectively cancel printing of files that
- are on the queue. You will be prompted to enter a file
- specification. DOS wildcard characters can be included
- so you can cancel as few or as many files as you want.
-
- Cancel All - Cancels all files from the queue.
-
- If your printer is not on-line when you cancel files from the queue, the
- program may 'hang' temporarily before displaying the revised queue. Try
- the same command from DOS when your printer is not on-line and you will
- get a similar response followed by an error message.
-
- When entering information at the directory, destination and file spec
- prompts the following keys are available for editing:
-
- Left and Right Arrow - Move cursor one position without affecting text.
-
- <Ctrl>-Left and
- <Ctrl>-Right - Move cursor one word without affecting text.
-
- <Home> <End> - Move cursor to beginning or end of entry.
-
- <Back Space> - Delete character left of cursor.
-
- <Del> - Delete character at cursor.
-
- <Esc> - Exit from editing if the cursor is at the first
- position in the field, otherwise delete all
- characters entered and move cursor to first
- position.
-
- <Crtl>-<End> - Delete all characters from the cursor to the
- end of the field.
-
- <Ins> - Toggle insert mode on and off. When on the
- cursor will be about twice its normal size.
-
- <Num Lock> - Toggle Num Lock on and off. When on a #
- character will be highlighted in the bottom
- right corner of the screen.
-
- <Caps Lock> - Toggle Caps Lock on and off. When on a C will
- be highlighted in the bottom right corner of
- the screen. This actually has no affect within
- this program because all input is forced to
- uppercase as it is entered.
-
-
-
- FM.DOC
- Printed: 03-04-1988 Page: 4
-
- OPTIONAL MODIFICATIONS (Notes for Programmers)
-
- Stack and Heap. Both the stack and heap sizes must be set so that the
- program will not reserve all available memory for itself at start-up.
- There is a compromise in this setting between how much memory is
- available for file buffering during copying and viewing and the
- amount of memory available when you use the dOs command to exit
- temporarily to DOS. The program has a very small data segment (less
- than 1k); the stack has been set at 8k (the program ran out of stack
- once when I had it set at 4k but I haven't tested the range in between).
- Most of the program's larger variables are stored on the heap and the
- program will use all available memory up to the maximum heap set using
- the $M compiler directive. The only problem that increased heap creates
- is that every byte of increased heap is a byte of decreased memory
- capacity when using the EXEC (dOs) procedure to exit temporarily to DOS.
- Experiment with these settings to find the combination that works best
- for your day-to-day use of the program. If you want to remove the dOs
- option and not restrict the heap, comment out the MemLimited compiler
- definition as explained in the source code comments. This will
- eliminate the dOs option from the compiled program and the program will
- be compiled with whatever default stack and heap settings you have set.
-
- Colors. The background and foreground colors are set in the
- InitVideo procedure included in FMScreen.PAS. I do not have
- a color display so I really do not know how the colors will appear.
- If they are not right, or you just have different color preferences,
- this is the procedure to modify. CheckSnow is set to TRUE in the
- InitVideo procedure if a color adapter is in use. This works well
- for the standard Turbo screen writing procedures but it is by-passed
- by both the window routines and the DisplayLine procedure. If you
- know of a way of stopping snow, the procedures to add it to are
- DisplayLine, WOpen and WClose.
-
- File Attributes. The GetFAttr and SetFAttr procedures in Turbo Pascal
- 4.0 allow you to read and set a file's attributes. This makes many
- file-handling procedures much easier than they were under version 3.0.
- In particular, you can now write programs that perform operations on
- read-only and hidden files by saving their attributes, performing the
- desired operation, and restoring the original attributes. In this
- implementation of the program I have restricted the display to files
- which have their read-only and/or archive bits set. All operations
- except erasing are allowed on read-only files. To display hidden
- and/or system files, change the attribute used in the call to
- FindFirst in the GetFilesList procedure contained in FMFile.PAS from
- ReadOnly to ReadOnly + Hidden [+ SysFile].
-
- From Program to Unit. Most of this program was originally written for
- inclusion in a much larger application which required easy manipulation
- of the files it produced. It became a separate program as I was
- converting the larger program to Turbo Pascal version 4.0, turning
- the old Include files into Units. Since Turbo Pascal version 4.0
- allows conditional compilation FM could be made into a unit and a
- program at the same time! This is probably not the primary use of
- conditional compilation but it is certainly useful when you include
- small utilities in your larger programs.
-
- If you want to include the File Manager in your own applications all you
- have to do is delete the '(* *)' comments around the {$DEFINE FMasUNIT}
- FM.DOC
- Printed: 03-04-1988 Page: 5
-
- statement at the top of FM.PAS. If you will not be setting a low maximum
- heap in your program you should also put comments around the
- {$DEFINE MemLimited} statement. This will eliminate the dOs option (which
- requires that the maximum heap be set) from the unit. That is all that has
- to be done. {$IFDEF xxx} and {$IFNDEF xxx} statements in FM.PAS do the rest!
- All variables and procedure declarations will be hidden from your main
- program except the FileManager procedure declaration which is compiled in the
- Interface section of the unit. The short sample program, FMUTest.PAS,
- provides an example of how to call the File Manager when used as a unit.
-
-
- FILES INCLUDED
-
- FM.PAS { Main Program File }
- FM.EXE { Executable version of FM.PAS }
- FM.TPU { Compiled Unit version of FM.PAS }
- FMScreen.PAS { Screen and keyboard status routines }
- FMInput.PAS { Input routines }
- FMFile.PAS { File-handling routines }
- FMView.PAS { View procedure }
- FMUTest.PAS { Short sample program that USES FM Unit and calls FM through }
- { the FileManager procedure declaration compiled into the }
- { program when it is compiled as a unit. You will have to }
- { remove the comments from the {$DEFINE FMasUNIT} statement in }
- { FM.PAS to re-compile this if FM.TPU is not available. }
- FMUTest.EXE { Compiled version of FMUTest.PAS. }
- FM.DOC { This file }
-
-
- SYSTEM REQUIREMENTS
-
- In its current configuration (8k Stack, 64k Heap), the program should
- run with as little as 98k of available RAM. More is needed to use the
- dOs option. Either monochrome or color monitors are acceptable.
- Turbo Pascal version 4.0 is required to re-compile the program. Because
- many low level machine-specific routines are used in the program, an
- IBM PC/XT/AT or close compatible running MS- or PC-DOS version 2.0 or above
- is required. A DOS version of 3.0 or greater is required to use the print
- spooling functions.
-