gurmeet:
Did you try to run your code? You should learn how, so you may trouble shoot it when it doesn't do what you want it to.
When I ran it, it stopped, showed the error message "ExpectedL BASE", and highlighted the 2 in the line,
option 2:
The problem here is that a label must be continuous, so, the fix is easy:
option2:
Next, to start you on the road of troubleshooting,, go down one line below the line,
DO: k$ = INKEY$: LOOP UTIL k$ <> ""
and press the F9 key, which creates a BREAKPOINT, or stopping line. That line should have a red background now. The program will execute until it reaches the above DO line.
Now, run the program, and press the down arrow key. The program stops on the next line, and, because it has an F9 key breakpoint, and you will see the code. Now, you can step through the code, one line at a time, by pressing F8 once, each time. You will notice that the program jumps from theline,
IF k$ = "q" THEN END
to the next line,
IF k$ = CHR$(0) + CHR$(80) AND Y <12> 8 THEN
but when you press F8 once more, instead of going to the next line, as you would expect, it jumps to the next line after the line
END IF
Now, we know that the line,
IF k$ = CHR$(0) + CHR$(80) AND Y <12> 8 THEN
must have an error of some kind! By observation, the problem turns out to not quite so simple. It is in the second part,
AND Y <12> 8 THEN
You see, the syntax is wrong! It should be,
AND(Y <12>
![Cool 8)](./images/smilies/icon_cool.gif)
THEN
But,when you run the code again and use the F8 key, you see that it still jumps past END IF. Aha, if you observe closely, you defined Y as 8, in,
Y - 8
so, you must change the above part to,
AND (Y <12>=
![Cool 8)](./images/smilies/icon_cool.gif)
THEN
making the whole line,
IF k$ = CHR$(0) + CHR$(80) AND (Y <12>=
![Cool 8)](./images/smilies/icon_cool.gif)
THEN
Now,your code should not jump doen past END IF.
After you fix the above, please continue to use the F9 and F8 keys to trouble shoot some more, until you get that part of your code working properly. Then, you will be ready to post your next question, on a particular line that you find doesn't do what you think it should.
If you are willing to learn by doing the above, I, and others, will be happy to continue to guide you through your proyect.