SUB SmalMenu (Menu$(), Title$, Selection, Row, Col, MaxItems, FGColr, BGColr, FGHiLite, BGHiLite, MenuNum, ExitCode) ' +---------------------------------------------------------------------+ ' | - S U B S m a l M e n u - | ' | | ' | Public Domain - FreeWare | ' +---------------------------------------------------------------------+ ' | Author: Donald B. "Don" Smith | ' | Email : smithdonb@earthlink.net | ' +---------------------------------------------------------------------+ ' | - ABOUT THE AUTHOR - | ' +---------------------------------------------------------------------+ ' | | ' | Hello. My name is Don Smith and I am a thirty-year retired teacher | ' | of Math/History/Spanish residing in Orange County, California. I | ' | am also a former six-year Sergeant of Marines. Who-Rah! On certain | ' | forums I am known as MarineDon. My email is: smithdonb@earthlink.net| ' | | ' +---------------------------------------------------------------------+ ' | - COPYING AND DISTIBUTING - | ' +---------------------------------------------------------------------+ ' | Since this code is public domain and freeware, anyone may freely | ' | copy and distribute it. If you use the QuickBasic code in one of | ' | your own programs, you do not have to cite my name as the author, | ' | and you may even change its name. | ' +---------------------------------------------------------------------+ IF Selection = 0 THEN Selection = 1 END IF part1: GOSUB part2 GOSUB part3 part2: GOSUB part5 'Adjust LOCATE to match your location of Title$ LOCATE Row - 2, Col + 2: PRINT Title$ FOR Count = 1 TO MaxItems LOCATE Row + Count, Col PRINT Menu$(Count); NEXT RETURN part3: FOR Count = Selection TO MaxItems LOCATE Row + Count, Col - 1 COLOR FGHiLite, BGHiLite PRINT " " + Menu$(Count) + " "; DO KeyPress$ = INKEY$ LOOP UNTIL LEN(KeyPress$) > 0 PressKey = ASC(RIGHT$(KeyPress$, 1)) LOCATE Row + Count, Col - 1 COLOR FGColr, BGColr PRINT " " + Menu$(Count) + " "; Selection = 1 IF PressKey = 13 THEN MenuNum = Count ExitCode = 0 EXIT SUB ELSEIF PressKey = 59 THEN ExitCode = PressKey MenuNum = Count EXIT SUB ELSEIF PressKey = 27 THEN COLOR 7, 0: CLS : LOCATE 1, 1, 1, 6, 7: END END IF IF ASC(RIGHT$(KeyPress$, 1)) = 72 THEN 'DnArrow (72) IF Count > 1 THEN Count = Count - 2 GOTO part4 ELSE Count = MaxItems - 1 GOTO part4 END IF END IF part4: NEXT GOTO part3 part5: MenuNum = Count - 1 IF Count = MaxItems THEN RETURN END IF Count = Count - 1 RETURN END SUB