' MENU.BAS -- This module handles the main menu
' $INCLUDE: 'J.INC'

DECLARE SUB Pstring (Msg$, Row)
DIM SHARED MyBox AS BoxType, TopRow, BotRow, LftCol, RtCol

SUB MainMenu
	CALL BoxCoords(MainMenuBox, MyBox)
	TopRow = MyBox.TopRow
	BotRow = MyBox.BotRow
	LftCol = MyBox.LftCol
	RtCol = MyBox.RtCol

	DO
		COLOR Normal, Background, Background
		CLS
		NormalBox (MainMenuBox)
		
		CALL Pstring("The Game of Jots", 1)
		CALL Pstring("Copyright 1989 PC Resource", 2)
		CALL Pstring("1. Play the Game", 5)
		CALL Pstring("2. Instructions", 7)
		CALL Pstring("3. Maintain Word List", 9)
		CALL Pstring("4. Quit", 11)
		CALL Pstring("   Press number of your choice", 14)
		DO
			choice$ = INPUT$(1)
		LOOP UNTIL choice$ >= "1" AND choice$ <= "4"
		SELECT CASE choice$
			CASE "1"
				DO
					PlayAGame
				LOOP UNTIL PlayAgain = FALSE
			CASE "2"
				Instructions
			CASE "3"
				WordMaintenance
			CASE "4"
				EXIT SUB
			CASE ELSE
		END SELECT
	LOOP
END SUB

SUB Pstring (Msg$, Row)
	LOCATE TopRow + Row, LftCol + (RtCol - LftCol - LEN(Msg$)) / 2, 0
	PRINT Msg$;
END SUB

