'===========================================================================
' Subject: DOS SIMULATION                     Date: 07-08-97 (21:20)       
'  Author: Michael G. Stewart                 Code: QB, QBasic, PDS        
'  Origin: mikegs@juno.com                  Packet: DOS.ABC
'===========================================================================
'DOS.BAS and DOS.BAT: A QBasic Version of MS-DOS
'Put Both Files in Your C:\ Directory, or Change as Instructed below.
'I've Changed The 'CD/CHDIR' Command! Read Help File!
'I've Also Added A New Command: LINES Changes The Rows And Columns Of
'Screen
'Have Fun
'Put My Name in Your Credits If You Use My Program.
'Send Me A Copy If You Change It! -Thanks
'Mike Stewart

CLS
PRINT "Arrowhead Imitation Disk Operating System (A-DOS) V. 1.5"
PRINT "Type 'Exit' To Return To Microsoft Windows or MS-DOS"
PRINT
PRINT
CHDIR "C:\"
curdir$ = "C:"
echo = 1
GOSUB prompt

prompt:
IF echo = 1 THEN PRINT curdir$; : INPUT ">", comand$
IF echo = 0 THEN INPUT "", comand$
GOSUB process

process:
comand$ = UCASE$(comand$)
IF comand$ = "RESTART" THEN GOSUB restart
IF comand$ = "HELP" THEN GOSUB help
IF comand$ = "ECHO OFF" THEN echo = 0: GOSUB prompt
IF comand$ = "ECHO ON" THEN echo = 1: GOSUB prompt
IF comand$ = "EXIT" THEN GOSUB quit
IF LEFT$(comand$, 5) = "LINES" THEN
 IF RIGHT$(comand$, 7) = "DEFAULT" THEN WIDTH 80, 25: PRINT "New Lines Setting Active: 25 * 80": GOSUB prompt
 rows = VAL(MID$(comand$, 7, 2))
 cols = VAL(MID$(comand$, 10, 2))
 IF cols = 0 THEN cols = 80
 WIDTH cols, rows
 PRINT "New Lines Setting Active:"; rows; "*"; cols
 GOSUB prompt
END IF
IF LEFT$(comand$, 2) = "CD" THEN
 IF RIGHT$(comand$, 2) = ".." THEN curdir$ = "C:": CHDIR "C:\": GOSUB prompt
 SHELL comand$
 curdir$ = curdir$ + "\" + MID$(comand$, 4)
 GOSUB prompt
END IF
IF RIGHT$(comand$, 2) = ":\" OR RIGHT$(comand$, 1) = ":" OR RIGHT$(comand$, 1) = "\" THEN
 SHELL comand$
 curdir$ = LEFT$(comand$, 1) + ":"
 GOSUB prompt
END IF
SHELL comand$
GOSUB prompt

quit:
CLS
PRINT "-------------------------------------------------------------------------------"
PRINT "Arrowhead Imitation Disk Operating System (AI-DOS) V. 1.5"
PRINT "Copyright (C) 1997 Arrowhead Corporation"
PRINT "All Rights Reserved"
PRINT
PRINT "Programed with:"
PRINT "MS-DOS QBasic"
PRINT "Version 1.1"
PRINT "Copyright (C) 1987-1992 Microsoft Corporation"
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "Press Any Key"                                                                '
SLEEP
SYSTEM

help:                                                                    
             
CLS
PRINT "---------------------------------------------------------------------"
PRINT "All MS-DOS Keywords Are Supported in AI-DOS"
PRINT "Except For The 'CHDIR'/'CD' Keyword as follows:"
PRINT "---------------------------------------------------------------------"
PRINT "                             CHDIR (CD)"
PRINT "Changes the current directory. 'CHDIR' Not Supported!"
PRINT "Syntax"
PRINT "   CD path"
PRINT "   CD .."
PRINT "Parameters"
PRINT "   path   Specifies the directory to change to. Directory must be in"
PRINT "          current directory."
PRINT "   ..     Changes to the C:\ Directory"
PRINT "--------------------------------------------------------------------"
PRINT "Press Any Key For New Keyword: LINES"
WHILE INKEY$ = "": WEND
CLS
PRINT "--------------------------------------------------------------------"
PRINT "New Keyword:                   LINES"
PRINT "Changes the Number of Rows And Colomns on the Screen"
PRINT "Syntax"
PRINT "   LINES numberoflines[*width]"
PRINT "   LINES DEFAULT"
PRINT "Parameters"
PRINT "   numberoflines  Specifies The Number of Rows On The Screen."
PRINT "                  Options Are: 25,43,50"
PRINT "   width          Specifies The Number of Columns On The Screen."
PRINT "                  Options Are: 40,80"
PRINT "   DEFAULT        Sets To Defaults (25*80)"
PRINT "--------------------------------------------------------------------"
PRINT
PRINT
GOSUB prompt

restart:
RUN

------------------8<-----------------CUT HERE-------------->8---------------
REM DOS.BAT

echo off
CLS
c:\dos\qbasic /run c:\dos.bas
REM       change this^^^^  if you are putting the file in another
directory.
REM       i.e. c:\dos\qbasic /run c:\dos\dos.bas
CLS
echo on
