SpartaDOS X Reference Manual

The Command Processor — Commands




PROMPT (Set System Prompt) Command

Index


Purpose

Change the system prompt.
 

Syntax PROMPT [prompt_string]
 
Type Internal
 
Related PATH
 
Remarks

The text in prompt_string is taken by SpartaDOS to be the new system prompt. Special meta-strings can be imbedded in the text in the form "$c" where 'c' is one of the following characters:

L   print current drive letter ('A' through 'I')
N   print current drive number ('1' through '9')
P   print path on current drive
D   print current date
T   print current time
R   print an EOL character (advance to next line)

NOTE: "P" will cause the current drive to be read every time <RETURN> is pressed to detect a disk change. This should be taken out of the path before parking a hard drive, since the "P" will read the disk and unpark the drive. A batch file changing the prompt, then parking the drive, would be very useful for this purpose.

If no parameter is specified, then the current prompt_string is displayed.

For example the command:

    PROMPT $L:$P>

will display a prompt in the form:

    B:>DOS>

assuming the current drive is 2 and the current path is "DOS". Also, the character '_' will display as a space rather an underline. (Thus a prompt can end in a space.)

The PROMPT command is really just a convenient form of the SET command, for example the above command could be performed by:

    SET PROMPT=$L:$P>

just as easily. The default value of the "prompt" variable is "D$N:" which displays the same prompt as older SpartaDOS versions. If the "PROMPT" variable is not defined, SpartaDOS X will prompt with a '>' character — the only way to clear the "PROMPT" variable is with the command:

    SET PROMPT

You can not use non-inverse lower case letters in the prompt because the command processor automatically converts all lower case characters to upper case before processing. Inverse and cursor control keys (preceded by the escape key) may be used in the prompt.

When using the '$P' meta-string in the prompt, the default drive will be read each time the prompt is printed. This will cause an error to be printed within the prompt if there is no disk or a bad disk in the default drive, or if the disk is of a format unrecognized by SpartaDOS X. (To use Atari DOS format disks with SpartaDOS X you must install the ATARIDOS.SYS driver).

Using the '$P" meta_string in the prompt can also cause problems when attempting to park a hard drive, since the drive will be "unparked" to read the path when the prompt is printed. The solution to this is to set the environment variable PROMPT to a value not containing '$P'. Since drives are usually parked only when you are, through using the computer, you may simply clear the PROMPT variable with a

    SET PROMPT

before parking the drive. You could set up a batch file to clear the prompt variable and then park the drive to simplify this operation.


Previous page

Next page