'===========================================================================
' Subject: A BASIC SHELL V1.0                 Date: 08-14-99 (20:50)       
'  Author: Mathew Wilson                      Code: PB                     
'  Origin: lastime16@hotmail.com            Packet: PB.ABC
'===========================================================================
' This is the Source Code for "A Basic Shell".
' This Source Code and Program is copyrighted by Mathew Wilson
' This Source Code was Written in Power Basic Ver 3.2
'
' This File may be changed and distributed as long as the original
' "A Basic Shell.exe" (or "ABASIC~1.exe"), Shell.bas and Shell.txt
' is distributed with the changed file/files.
'
' Any further Questions can be sent to lastime16@hotmail.com
'
'
'
'
'
'
'
'
'
'Starting Variables
shell "c:"
shell "cd\"
current_drive$ = "c:"
directory_series$ = ""
current_directory$ = ""
Press_Key$ = ""
Run_Program$ = ""


'Credits
cls
locate 7,31: Print "_______________________"
locate 8,30: Print "|     A Basic Shell     |"
locate 9,30: Print "|      Version 1.0      |"
locate 10,30: Print "|                       |"
locate 11,30: Print "|    Copyrighted and    |"
locate 12,30: Print "|      Created  By      |"
locate 13,30: Print "|     Mathew Wilson     |"
locate 14,30: Print "|                       |"
locate 15,30: Print "| lastime16@hotmail.com |"
locate 16,30: Print "|_______________________|"

Loop_A:
Press_Key$ = Inkey$
If Press_Key$="" goto Loop_A:


'Start Screen
Start_Screen:
cls
locate 1,5: Print "Directory"
locate 2,5: Print "^"
locate 1,20: Print "Run"
locate 2,20: Print "^"
locate 1,29: Print "Options"
Locate 2,29: Print "^"
locate 1,43: Print "Dos"
locate 2,45: Print "^"
Locate 1,52: Print "Quit"
Locate 2,52: Print "^"
locate 4,1: Shell "dir/w"

Loop_B:
Press_Key$ = Inkey$
If Press_Key$="D" goto Directory:
If Press_Key$="d" goto Directory:
If Press_Key$="R" goto Runn:
If Press_Key$="r" goto Runn:
If Press_Key$="O" goto Options:
If Press_Key$="o" goto Options:
If Press_Key$="S" goto Dos:
If Press_Key$="s" goto Dos:
If Press_Key$="Q" goto Quit:
If Press_Key$="q" goto Quit:
Goto Loop_B:


'Change Drive/Directory Routine
Directory:
locate 1,5:  Print "DIRECTORY"
locate 2,5:  Print "~~~~~~~~~"
locate 4,1:  Print " __________________________________________________"
locate 5,1:  Print "| Current Drive:                                   |"
locate 6,1:  Print "|         ^    "; Current_Drive$;"                                  |"
locate 7,1:  Print "|                                                  |"
locate 8,1:  Print "| Current Directory:                               |"
Locate 9,1:  Print "| ^                "Directory_Series$;"                                |"
locate 10,1: Print "|                                                  |"
locate 11,1: Print "|                   Okay                           |"
locate 12,1: Print "|                   ^                              |"
Locate 13,1: Print "|__________________________________________________|"

Loop_C:
Press_Key$ = Inkey$
If Press_Key$="D" goto Change_Drive:
If Press_Key$="d" goto Change_Drive:
If Press_Key$="C" goto Change_Directory:
If Press_Key$="c" goto Change_Directory:
If Press_Key$="O" goto Start_Screen:
If Press_Key$="o" goto Start_Screen:
Goto Loop_C:

Change_Drive:
Locate 5,3: Print "CURRENT DRIVE"
Locate 6,3: Print "~~~~~~~ ~~~~~"
Locate 7,17: Input Current_Drive$
Locate 16,5: Shell Current_Drive$
Goto Directory:

Change_Directory:
Locate 8,3: Print "CURRENT DIRECTORY"
Locate 9,3: Print "~~~~~~~ ~~~~~~~~~"
Locate 10,17: Input Current_Directory$
Locate 16,5: Shell "cd "+Current_Directory$
Directory_Series$ = Directory_Series$ + "\" + Current_Directory$
Goto Directory:


'Run Program Routine
Runn:
locate 1,20: Print "RUN"
locate 2,20: Print "~~~"
locate 4,1:  Print " __________________________________________________"
locate 5,1:  Print "|                                                  |"
locate 6,1:  Print "| Run:                                             |"
locate 7,1:  Print "|                                                  |"
Locate 8,1:  Print "|__________________________________________________|"
locate 7,6:  Input Run_Program$
If Run_Program$ = "" Then Goto Start_Screen:
Shell Run_Program$
Goto Start_Screen:

'Change Options Routine
Options:
locate 1,29: Print "OPTIONS"
Locate 2,29: Print "~~~~~~~"
locate 4,1:  Print " __________________________________________________"
locate 5,1:  Print "|                                                  |"
locate 6,1:  Print "|          There are currently no options.         |"
locate 7,1:  Print "|               Check Later Versions.              |"
Locate 8,1:  Print "|__________________________________________________|"

Loop_D:
Press_Key$ = Inkey$
If Press_Key$="" goto Loop_D:
Goto Start_Screen:


'Dos Prompt Routine
Dos:
locate 1,43: Print "DOS"
locate 2,43: Print "~~~"
locate 4,1:  Print " __________________________________________________"
locate 5,1:  Print "|                                                  |"
locate 6,1:  Print "|  A Basic Shell - DOS Mode - Type Exit to return  |"
Locate 7,1:  Print "|__________________________________________________|"
Locate 8,1:  Print "                                                                           "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
Print "                                                                             "
locate 6,1:  Shell
Goto Start_Screen:


'Quit Program
Quit:
locate 4,1:  Print " __________________________________________________"
locate 5,1:  Print "|                                                  |"
locate 6,1:  Print "|  Yes         Do You Want to Quit?            No  |"
locate 7,1:  Print "|  ^                                           ^   |"
Locate 8,1:  Print "|__________________________________________________|"

Loop_E:
Press_Key$ = Inkey$
If Press_Key$="y" goto End_:
If Press_Key$="Y" goto End_:
If Press_Key$="n" goto Start_Screen:
If Press_Key$="N" goto Start_Screen:
Goto Loop_E:


End_:
