Breakdown of PROMPT Example

Index

The Example

PROMPT $E[s$E[H$E[30;41m$E[K$E[4CAlt-Enter toggles full screen and window$E[15CType "EXIT" to quit $E[37;40m$E[u$P$G

The Result

   Alt-Enter toggles full screen and window Type "EXIT" to quit   

C:\WINDOWS>_



Analysis

$E[sSaves current cursor positionBecause the cursor is to be moved to write the top line
$E[HMove cursor to top left hand corner of screenThis could also have been written "$E[0;0H", "$E[f", or "$E[0;0f"
$E[30;41mChanges background colour to red and text to blackThis both clears extraneous characters from the top line of the display and makes the whole line red
$E[KClears from the cursor to the end of the line
$E[4CMoves the cursor 4 spaces to the rightFormatting and displaying the text to be displayed in the top line
Alt ... windowText to be displayed
$E[15CMoves the cursor 15 spaces to the right
Type ... quitMore text
$E[37;40mChanges colour to white text on blackChanges colours back to the default
$E[uMoves the cursor back to the saved positionDisplays the prompt where it is expected
$PDisplay current drive and directoryDisplays the standard prompt
$GDisplay the ">" sign

Note: All those codes beginning with "$E[..." require the Ansi.sys device driver to be loaded.


If you should have any comments or suggestions,
please contact: Bob Watson
.
This page last revised:
December 9, 1999.