'===========================================================================
' Subject: BASIC OPERATING SYSTEM             Date: 05-19-96 (18:39)       
'  Author: Darryl Schneider                   Code: QB, QBasic, PDS        
'  Origin: fish2@datanet.ab.ca              Packet: MISC.ABC
'===========================================================================
'BOS (Basic Operating System) 1.1
'This program was written to mimic the functions
'and commands available with the DOS Prompt. To
'see a list of commands, type HELP at the input
'prompt and an option menu will come up. In order
'for the program to work properly, you must type
'in proper file names and directories.
'
'Written by Darryl Schneider
'fish2@datanet.ab.ca
'The QBasic Zone
'http://www.geocities.com/SiliconValley/4244/qbasic.html
'
'start of program
'
DEFSTR A-M, P-Z                   'declare the variables
DEFINT N-O
COLOR 15                          'set default color
MESSAGE = "C:\"                   'and message

CLEARSCREEN:
CLS

START:
PRINT MESSAGE;
INPUT "", PROMPT                  'user prompt

COMMANDS:

EX3 = LEFT$(PROMPT, 6)            'This block of code changes
EX3 = UCASE$(EX3)                 'the message prompt
IF EX3 = "PROMPT" THEN
        EX4 = MID$(PROMPT, 8)
        MESSAGE = EX4
        PRINT ""
        GOSUB START
END IF

PROMPT = UCASE$(PROMPT)           'User prompt is converted into
                                  'uppercase

EX1 = LEFT$(PROMPT, 4)            'This block of code
IF EX1 = "DIR\" THEN              'displays the DIR listing
        EX2 = MID$(PROMPT, 5)     'for a specific directory
        FILES EX2
        PRINT ""
        GOSUB START
END IF

EX5 = LEFT$(PROMPT, 6)             'This block of code
IF EX5 = "MKDIR\" THEN             'makes a directory
        EX6 = MID$(PROMPT, 7)
        MKDIR EX6
        PRINT ""
        GOSUB START
END IF

EX7 = LEFT$(PROMPT, 6)             'This block of code
IF EX7 = "RMDIR\" THEN             'removes a directory
        EX8 = MID$(PROMPT, 7)
        RMDIR EX8
        PRINT ""
        GOSUB START
END IF

EX11 = LEFT$(PROMPT, 7)
IF EX11 = "RENAME\" THEN
        ALD = MID$(PROMPT, 8)
        PRINT "Enter new file name for "; ALD;
        INPUT ":", AEW
        NAME ALD AS AEW             'This block of code
        PRINT ""                    'renames a file
        GOSUB START
END IF

EX12 = LEFT$(PROMPT, 7)
IF EX12 = "DELETE\" THEN
        DELETEFILE = MID$(PROMPT, 8)
        KILL DELETEFILE               'This block of code
        PRINT ""                      'deletes a file
        GOSUB START
END IF

EX9 = LEFT$(PROMPT, 6)
IF EX9 = "COLOR\" THEN
        EX10 = MID$(PROMPT, 7, 2)      'changes text color
        IF EX10 = "01" THEN COLOR 1
        IF EX10 = "02" THEN COLOR 2
        IF EX10 = "03" THEN COLOR 3
        IF EX10 = "04" THEN COLOR 4
        IF EX10 = "05" THEN COLOR 5
        IF EX10 = "06" THEN COLOR 6
        IF EX10 = "07" THEN COLOR 7
        IF EX10 = "08" THEN COLOR 8
        IF EX10 = "09" THEN COLOR 9
        IF EX10 = "10" THEN COLOR 10
        IF EX10 = "11" THEN COLOR 11
        IF EX10 = "12" THEN COLOR 12
        IF EX10 = "13" THEN COLOR 13
        IF EX10 = "14" THEN COLOR 14
        IF EX10 = "15" THEN COLOR 15
        IF EX10 = "DF" THEN COLOR 15
        PRINT ""
        GOSUB START
END IF

SELECT CASE PROMPT
     CASE "DIR"
        FILES MESSAGE             'displays DIR listing for
        PRINT ""                  'the prompt directory
        GOSUB START
     CASE "DATE"
        PRINT DATE$               'displays date
        PRINT ""
        GOSUB START
     CASE "TIME"
        PRINT TIME$               'displays time
        PRINT ""
        GOSUB START
     CASE "DOSSHELL"
        PRINT "Error 002 - DOS cannot be started from the BOS Prompt"
        PRINT ""
        GOSUB START
     CASE "WIN"
        PRINT "Error 003 - Windows cannot be started from the BOS Prompt"
        PRINT ""
        GOSUB START
     CASE "ABOUT"
        PRINT "            BOS"
        PRINT "        Version 1.1"
        PRINT " Written by Darryl Schneider"
        PRINT ""
        GOSUB START
     CASE "Q"
        GOSUB QUIT                'quits
     CASE "QUIT"
        GOSUB QUIT                'quits
     CASE "MOUSE"
        PRINT "Error 004 - BOS does not support the mouse"
        PRINT ""
        GOSUB START
     CASE "CLS"
        GOSUB CLEARSCREEN              'clears the screen
     CASE "HELP"
        GOSUB Help                     'goes to help
     CASE ELSE
        GOSUB START                    'back to start

END SELECT

QUIT:
END                'ends program

Help:
CLS
PRINT ""
PRINT "         BOS (Basic Operating System) Prompt Help"
PRINT ""
FOR NUM = 1 TO 58
        PRINT CHR$(196);
NEXT NUM
PRINT ""
PRINT "         1. Keyboard Commands at the BOS Prompt"
PRINT "         2. Text Color Code Chart"
PRINT "         3. Exit BOS Prompt Help"
PRINT ""
INPUT "         Which option would you like(1-3)"; OP
SELECT CASE OP
        CASE 1
           GOSUB KCBP
        CASE 2
           GOSUB TCCC
        CASE 3
           GOSUB START
        CASE ELSE
           GOSUB Help
END SELECT

KCBP:
CLS
PRINT ""
PRINT "     BOS - Keyboard Commands at the BOS Prompt"
PRINT ""
FOR NUM = 1 TO 58
        PRINT CHR$(196);
NEXT NUM
PRINT ""
PRINT "CLS                  - clears the screen"
PRINT "DIR                  - shows directory listing for BOS Prompt"
PRINT "DIR\directory        - allows you to view a directory listing"
PRINT "MKDIR\directory      - allows you to make a new directory"
PRINT "RMDIR\directory      - allows you to remove a directory"
PRINT "COLOR\##             - allows you to change text color"
PRINT "RENAME\filename      - allows you to rename a file"
PRINT "DELETE\filename      - allows you to delete a file"
PRINT "PROMPT_message       - allows you to enter a new prompt"
PRINT "TIME                 - displays the current time"
PRINT "DATE                 - displays the current date"
PRINT "Q or QUIT            - exits BOS Prompt"
PRINT "HELP                 - goes to BOS Prompt Help"
PRINT "ABOUT                - shows version of BOS and author's name"
PRINT ""
PRINT "*** When you are typing a file name or directory, type the"
PRINT "WHOLE name or directory. (e.g. C:\BOS\BOS11.EXE)"
PRINT ""
PRINT "Press any key to return to BOS Prompt Help..."
DO
R = UCASE$(INKEY$)
IF R = "Q" THEN GOSUB QUIT
LOOP WHILE INKEY$ = ""
GOSUB Help

TCCC:
CLS
PRINT ""
PRINT "     BOS - Text Color Code Chart"
PRINT ""
FOR NUM = 1 TO 58
        PRINT CHR$(196);
NEXT NUM
PRINT ""
PRINT " Blue   -  01       Bright Blue     -  09"
PRINT " Green  -  02       Bright Green    -  10"
PRINT " Cyan   -  03       Bright Cyan     -  11"
PRINT " Red    -  04       Peach           -  12"
PRINT " Purple -  05       Bright Purple   -  13"
PRINT " Orange -  06       Bright Yellow   -  14"
PRINT " White  -  07       Bright White    -  15"
PRINT " Gray   -  08"
PRINT ""
PRINT "Bright White (15) is the default text color and"
PRINT "can be implemented by typing COLOR\DF at the BOS"
PRINT "Prompt"
PRINT ""
PRINT "Press any key to return to BOS Prompt Help..."
DO
R = UCASE$(INKEY$)
IF R = "Q" THEN GOSUB QUIT
LOOP WHILE R = ""
GOSUB Help
'
'end of program





