'===========================================================================
' Subject: QBASIC PROGRAMMER V1.0             Date: 07-06-98 (17:27)       
'  Author: Nitin Reddy                        Code: QB, QBasic, PDS        
'  Origin: reddy@emirates.net.ae            Packet: MISC.ABC
'===========================================================================
'Qbasic Programmer          By Nitin Reddy
'
'If anyone figures out how to add background music as in the ABC packet reader
'email to : reddy@emirates.net.ae with the modified file attached to it.
'
'Since this is the first version, the next version will have more possibilities
'better menu system and help.
'
'
DECLARE SUB DrawLine ()
DECLARE SUB DrawPoint ()
DECLARE SUB WriteText ()
DECLARE SUB Playmusic ()
DECLARE SUB ScreenMode ()
DECLARE SUB Halt ()
DECLARE SUB ColorChang ()
DECLARE SUB Finish ()

CLS
PRINT
PRINT " Qbasic programmer Ver 1.0"
PRINT
VIEW PRINT 4 TO 24

GetFilename:
'INPUT "Enter filename : ", File$
'IF INSTR(File$, ".") = 0 THEN
'File$ = File$ + ".bas"
'IF LEN(File$) > 12 THEN PRINT "Filename too large!": GOTO GetFilename
'END IF

File$ = "CON"
PRINT
OPEN File$ FOR APPEND AS #1
DO
CLS
PRINT " 1) Draw a line"
PRINT " 2) Draw a point"
PRINT " 3) Write something"
PRINT " 4) Change the screen mode"
PRINT " 5) Wait"
PRINT " 6) Play musical note"
PRINT " 7) Change colour"
PRINT " 8) Close file"

PRINT
SELECT CASE INPUT$(1)
CASE "1": DrawLine
CASE "2": DrawPoint
CASE "3": WriteText
CASE "4": ScreenMode
CASE "5": Halt
CASE "6": Playmusic
CASE "7": ColorChang
CASE "8": CLOSE : SYSTEM
END SELECT
LOOP

SUB ColorChang
CLS
INPUT " Enter colour : ", COL$
PRINT #1, "COLOR " + COL$
END SUB

SUB DrawLine
CLS
PRINT
INPUT "Starting Point (X1,Y1): ", X1$, Y1$
INPUT "Ending Point (X2, Y2) : ", X2$, Y2$
INPUT "Colour (1-15) : ", C$
PRINT #1, "LINE (" + X1$ + "," + Y1$ + ")-(" + X2$ + "," + Y2$ + "), " + C$
END SUB

SUB DrawPoint
CLS
PRINT
INPUT " Enter coordinates of point (X,Y) : ", X$, Y$
INPUT " Enter color : ", C$
PRINT #1, "PSET (" + X$ + "," + Y$ + "), " + C$
END SUB

SUB Halt
CLS
INPUT "Enter no. of seconds : ", SEC$
PRINT #1, "SLEEP " + SEC$
END SUB

SUB Playmusic
CLS
LINE INPUT " Enter Notes : ", Txt$
PRINT #1, "PLAY " + CHR$(34) + Txt$ + CHR$(34)
END SUB

SUB ScreenMode
CLS
INPUT "Enter screen mode : ", SCR$
PRINT #1, "SCREEN " + SCR$
END SUB

SUB WriteText
CLS
LINE INPUT " Enter text : ", Txt$
PRINT #1, "PRINT " + CHR$(34) + Txt$ + CHR$(34)
END SUB
