Hi all,
I know how to use the basics of the LOCAT Row,Column statement however I have a quick question about it.
I want to print the character "0" on a new line after my last PRINT statement. However due to things previous in the program this line may not always be the same so I can't set the Row and Coumn to a definite position.
So how to I locate the previous PRINT statement and put the character on a new line after that?
NOTE: Due to what I am trying to do here I cannot just use another PRINT Statement as I am creating an animation by making the character move. Thanks for any help.
LOCATE question
- The Walrus
- Veteran
- Posts: 87
- Joined: Fri Apr 01, 2005 7:19 am
- Location: Denmark
- Contact:
Well, my code is:
So you can see I want the 0 to jump back and forth between coulmn 1 and 2. However at the moment when it loops around it just starts a new line (yes I need a loop here). How can I keep it all on the same line?[/code]
Code: Select all
FOR Counter = 0 TO 60
row = CSRLIN
LOCATE row, 1
PRINT "0"
SLEEP 1
LOCATE row, 1
PRINT " "
LOCATE row, 2
PRINT "0"
NEXT Counter
Here's one way to do it!
I think you went coding without any planning at all!, from what I understood, you want to creat a primitive animation of a "0" that jumps between Column 1 and 2, here's the code for it,
Code: Select all
CLS
row = CSRLIN ' Set 'row' to the current Row location
FOR Counter = 0 TO 60
LOCATE row, 1 ' Set cursor position to row and column 1
PRINT "0" ' Print '0'
SLEEP 1 ' Wait a sec or a key press
LOCATE row, 1 ' Again locate row and column 1
PRINT " " ' Erase '0'
LOCATE row, 2 ' Locate row and column 2
PRINT "0" ' Print '0'
SLEEP 1
LOCATE row, 2 ' Locate row and column 2 again
PRINT " " ' Erase '0'
NEXT Counter
END
~AiRMaN~