My 'X' won't move up correctly! =[

by drew

'This code looks perfect, to me. Can anyone help describe why you can't move up correctly. It 'glitches every few lines, but moving down, right or left works perfectly..

' For now i'm ignoring the showcode SUB

' Thanks

DECLARE SUB getkey ()
DECLARE SUB showcode ()
CLS

DIM SHARED code$(1000), display, over, k$, movedown
display = 21
over = 50
movedown = 1




DO
k$ = INKEY$ ' storing the INPUT into the variable K


getkey ' this sub gets user input and outputs it correctly
LOOP

SUB getkey



SELECT CASE k$ ' menu selection for user input (K)

CASE CHR$(0) + CHR$(77) ' USER ENTERS RIGHT

IF over < 80 THEN

over = over + 1

LOCATE movedown, over: PRINT "X"

END IF


CASE CHR$(0) + CHR$(75) ' USER ENTERS LEFT

IF over > 9 THEN
over = over - 1


LOCATE movedown, over: PRINT "X"
END IF


CASE CHR$(0) + CHR$(80) ' USER ENTERS DOWN
IF movedown < 21 THEN
movedown = movedown + 1

LOCATE movedown, over: PRINT "X"
END IF


CASE CHR$(0) + CHR$(72) ' USER ENTERS UP
IF movedown > 3 THEN

movedown = movedown - 1

LOCATE movedown, over: PRINT "X" ' this is the part that is broken, i think


END IF

END SELECT





END SUB

SUB showcode ' JUST IGNORE, IDKK WHAT I WANT THIS TO DO, YET
position = 1

FOR A = display - 20 TO display
position = position + 1

IF A < 10 THEN LOCATE position, 1: PRINT A; " : "
IF A > 9 AND A < 100 THEN LOCATE position, 1: PRINT A; " : ";
IF A > 99 THEN LOCATE position, 1: PRINT position; " : ";

LOCATE position, 9: PRINT code$(A)



NEXT A


END SUB

Posted on Mar 19, 2008, 11:13 AM
from IP address 98.26.104.159

Respond to this message   

Goto Forum Home


Response TitleAuthor and Date
* It worked for me.roy on Mar 19
 * It worked for me too. Maybe the OP wants the X to do some other stuff?qbguy on Mar 19
  Not Fair!drew on Mar 19
   Run this on Mar 19
    * Yeah, MAC.. I guess my EXE is broken. I did everything you told me, and it still skipsdrew on Mar 19
     * Nope, Just downloaded 1.0 from the DOWNLOAD section.. Still skips! =[drew on Mar 19
  Yeah, drew, What exactly do you want it to do? on Mar 19
   Specs:drew on Mar 19
    Hey drew. on Mar 19
     INKEY loop type of deal?drew on Mar 19
    * Maybe there's something wrong with the up key on your keyboard.Solitaire on Mar 19
     Good thinking on Mar 19
      lol! yeah, i'll try that, although..drew on Mar 20
1. THE BUG EXISTS! 2. THE BUG IS A FAULT IN NTVDM.EXE on Mar 20
 Micro$oft can do no wrong!!!!!!!!!!!! (Hey Drew, this CODE WILL WORK!)Pete on Mar 20
  loll! so i found an error in microsoft.. what are the odds?drew on Mar 20
   *With Windows? I'd say about 100 to 1, your favor. on Mar 21
    * Why not look for bugs in TeX? Knuth pays $327.68/bug on Mar 21
Re: My 'X' won't move up correctly!Ralph on Mar 20
 loll! Your right, that works, too.drew on Mar 21
  RE: Why do you guys think that it's happening ... and never got this result, before? on Mar 21
   We should put a list together, and give it to windows..drew on Mar 22
   * Because I program using ME, long live ME. lolroy on Mar 22
   *Galleon: It happened to me, too!Ralph on Mar 22