< Previous | Contents (GEM) | Contents (DOS+)

8  THE NEXT STEP


8.1 Introduction

This Introduction has given you the basic information you need to run applications under DOS Plus. It has concentrated on the commands most frequently used for file manipulation.

However, DOS Plus has far more facilities than can be covered in here. It has other commands and facilities, and there are more versatile and complex forms of the commands you've already met. Whatever you might want to do with DOS Plus, there is almost certainly a way of doing it.

This chapter very briefly outlines some of these extra facilities. You will find full details in the Digital Research's DOS Plus Users' Guide.

8.2 Advanced file copy facilities: COPY and PIP

The COPY command can include options to the files you specify. For example, the + option has already been described in Chapter 4. It is used to combine several files into one file. The most useful of the remaining options is probably /V, which compares source and destination files. For example.

A>COPY <sourcefile> <destfile> /V RETURN

will cause the newly copied file destfile to be verified against sourcefile, to check that the copy is complete and accurate. (Note that the copying will take longer because of the verification stage).

You may also find the /A and /B options useful if you want to read or write ASCII text files. For example:

A>COPY <sourcefile> <destfile> /A RETURN

causes the destination file to be written as an ASCII (text) file followed by an end-of-file character CTRL-Z. On a source file /A will copy characters up to the first CTRL-Z, and then ignore anything that follows. /B has the same effect except that it ignores any CTRL-Z characters in a source file, and doesn't add a CTRL-Z to a destination file.

COPY can also be used to copy files between disc, keyboard, screen and printer by specifying an output device. In chapter 5 the device name CON: was used to create a file by 'copying' it from the keyboard. You can also use CON: instead of the destination filename to display files on the console screen. For example:

A>COPY B:myfile con: RETURN

displays the file on the screen.

Perhaps more useful is the device name PRN: which you can use to copy ASCII (text) files onto your printer:

A>COPY *.txt PRN: RETURN

gives you a printed copy of all the txt files from the disc in drive A.

Another command that performs much the same operations as COPY is the Peripheral Interchange Program (PIP). PIP is one of the most powerful and versatile DOS Plus commands. It takes the basic form:

A>PIP <destfile>=<sourcefile> RETURN

but allows you to specify twenty or so different options to process your files while they are being copied. You can also specify 'auxiliary' devices such as printer or keyboard for the source and destination of the file. In addition, if you have a sequence of copying commands to enter, you can save time by using PIP in a multiple command mode. This saves you from loading the program into memory for each copy operation.

Here are some of the PIP options:

[A]    is the archive option, which will only copy files that have been modified since the last backup operation.
 
[C]   asks you to confirm each file before the copy operation, so that you can selectively copy files or groups of files.
 
[L]   after the sourcefile changes all uppercase characters in the sourcefile to lowercase in the destination file. [U] will achieve the opposite, changing lowercase to uppercase in the destination file.

8.3 Background Programs

DOS Plus allows you to run certain programs in the background. This means that you can run your applications using the screen and keyboard as usual, but up to three other programs may be running (fairly slowly) at the same time.

This is possible because the memory and the computer processor are shared between the various background programs and the foreground program. DOS Plus manages the use of store and processing power in such a way that you may not even notice that your foreground program is running a bit more slowly than usual. (In fact you can use commands ADDMEM, COMSIZE and SLICE to specify different timesharing rates to suit your particular requirements).

You are kept informed of what is happening in the background via the BACKG command, which displays the names and current status of your background programs. For a status display, type:

A>BACKG RETURN

Two background programs are provided with DOS Plus: ALARM (a diary/alarm facility) and PRINT.

8.3.1 The ALARM command

The ALARM command enables you to send yourself messages at specified times and days. It is a background program that can be used as a diary or `bring up' reminder.

The options are:

A>ALARM RETURN

This will display a list of the alarms currently set, and whether ALARM is ON or OFF.

A>ALARM <date time message> RETURN

This adds the specified alarm to the ALARM list, and starts ALARM running if it isn't already. If you don't specify a date, the current date is chosen.

For example:

A>ALARM 16/02/86 1:00 Lunch at the Unicorn RETURN

will add that message to the list. At the specified time (if ALARM is running) the computer will beep and display the message on the screen.

A>ALARM <date time> /C RETURN

This cancels the specified alarm. The /T option deletes all the entries and terminates the program. Finally:

A>ALARM /ON RETURN

starts ALARM running and

A>ALARM /OFF RETURN

stops the program but retains the alarm entries.

8.3.2 The PRINT command

PRINT allows you to print files while you are working on another program in the foreground.

For example:

A>PRINT chapter1.tex RETURN

starts printing chapter1.tex and enables you to carry on writing (say) chapter2.tex. If you finish chapter2.tex before PRINT has finished printing chapter1.tex, simply type:

A>PRINT chapter2.tex RETURN

PRINT will add the file to a print queue, and print it when it has finished with chapter1.tex. Up to 32 files may be queued in this way at any one time. Alternatively you can type in the whole print queue at once:

A>PRINT one.tex two.tex three.tex four.tex RETURN

To remove a file from the print queue at any time, use the /C option, for example:

A>PRINT three.tex /C RETURN

will remove three.tex from the print queue.

Note: You cannot remove an entry while it is being printed, but only if it is waiting to be printed.

PRINT also supports wildcard file specifications. For example:

A>PRINT *.bak RETURN

will print all files with the bak filetype.

Note: If you are using a directory structure, all the files you specify in a PRINT command must be in the current directory when the PRINT command is issued.

Use the /T option to terminate the PRINT program:

A>PRINT /T RETURN

8.3.3 Other Background Programs

You can develop your own programs to run in the background. See the DOS Plus Programmers' Reference Manual for details.

8.4 Changing the prompt – the PROMPT command

The PROMPT command enables you to change the standard prompt from (for example) A> to anything you want. It has the form:

A>PROMPT <text> RETURN

where <text> can be any character string except $, =, <, >, or |

For example:

A>PROMPT Type command here: RETURN

will cause A> to be replaced by:

Type command here:

until you change the prompt.

In addition, you can include certain special strings, indicating them with the $ character. The special strings are:

      t     the time
  d   the date
  p   the current directory
  v   the version of DOS Plus
  n   the default drive letter
  u   the user number
  $   the $ character
  g   the > character
  l   the < character
  b   the | character
  q   the = character
  e   the escape character (ESC)
  h   backspace

Any other character following $ is ignored. PROMPT without any text resets the prompt to the default DOS Plus prompt.

For example:

A>PROMPT $p$g RETURN

sets the prompt to the current directory level followed by the > character:

\TOM\MEMOS>

8.5 More on Batch Programs

In Chapter 6 batch programs were introduced as a text file of commands that can be executed by entering the filename. The subcommands REM and PAUSE were also introduced.

Batch programs can be made more useful by introducing some other subcommands, and by using variables.

Briefly, some other subcommands are:

ECHO       Normally commands are displayed on the screen as they are executed. ECHO OFF and ECHO ON can be used to switch this display off and on again. ECHO message will substitute a message for the commands.
 
GOTO   If you add labels to your file, that is, any string of up to 8 characters preceded by a colon, you can branch to the command after that label, for example: GOTO ERROR . . :ERROR REM Error sequence
 
IF  

This takes the form:

IF {NOT} <condition> <command>

where NOT is optional. The condition can be either:

<string1>==<string2>

Or

EXIST <filespec>

If condition is true, then the command is executed. For example:

IF EXIST temp.tex REN temp.tex temp.bak RETURN

or

IF %%I==OK ECHO file found RETURN

where %%I is a variable that contains a string.

You can also pass parameters to a batch program by using any of the ten variables %1 to%9. For example:

A>COPY CON: listing.bat RETURN

COPY %1.txt %2.txt
TYPE %0
CTRL-Z

A>listing prog1 B:prog2 RETURN

Listing would replace %0, prog1 would replace %1 and B:prog2 would replace %2. The listing on the screen of listing.bat would be:

COPY PROG1.TXT B:PROG2.TXT
TYPE LISTING

8.6 Other commands

Some of the other DOS Plus commands are:

CLS: clears the screen of the current display.

DATE: displays and changes the date

TIME: displays and changes the time.

FSET: sets file and drive-related attributes such as Read Only and Read/Write

SDIR: displays extra information about file status

SET: displays and changes the DOS Plus environment buffer, for example to change the number of lines or the length of lines displayed on the screen.

DEVICE: changes character device characteristics e.g. sets up serial line BAUD rates.

This selection of commands is intended to illustrate how DOS Plus can be used to achieve some very complex operations with a fairly small number of commands. Almost anything can be done, but you need to understand DOS Plus (and your applications) very well before attempting anything really sophisticated. The few commands described in the early chapters of this book will probably suffice for most of your activites.

< Previous | Contents (GEM) | Contents (DOS+)

About the Master 512 | Bibliography