Did you copy in "|LTPD" or did you make it LLTPD?

If I recall correctly, the TI-OS takes your cursor to the row and column the error has been encountered. Where is the cursor when you goto the error?
I'm using TokenIDE, so it is supposed to be that way. |L represents the listy L. The cursor was on the top left corner of this subprogram when I pressed goto. Note that the problem occurred the first time the script was run, not only the time that it rotated off the board.

EDIT: I copied your (Kerm's) code, removed my syntax error comment, and moved one token in the second line to work with TokenIDE (the | which kerm left before the 7). Now, the syntax error moved, see code for details:


Code:
{0,0,0,0,0,0,0->|LTPD
If 7>|LCPD(7:Then
For(I,0,2
~|LCPD(2I+1)->|LTPD(2I+2
|LCPD(2I+2)->|LTPD(2I+1
End
Delvar RFor(I,0,2 //SYNTAX ERROR ON THE DELVAR!!
If A+|LTPD(2I+1)>10 or A+|LTPD(2I+1)<1 or B-|LTPD(2I+2)>20 or B-|LTPD(2I+2)<1 or [A](B-|LTPD(2I+2),A+|LTPD(2I+1
1->R
End
If not(R:Then
For(I,0,2
Pt-Off(~1+3(A+|LCPD(2I+1)),62-3(B-|LCPD(2I+2)),2)
End
For(I,1,6)
|LTPD(I)->|LCPD(I):End
For(I,0,2)
Pt-On(~1+3(A+|LCPD(2I+1)),62-3(B-|LCPD(2I+2)),2)
End
End
End
Double post Sad Data moved above, please delete this post.
Are you sure that that's the Delvar token, not a series of seven characters 'D', 'e', ...?

Edit: Be careful not to double-post, please!
Oops! It was D/e/l/v/a/r instead of the token DelVar, so TokenIDE didn't catch it. Testing now...

Edit: That fixed the every run errors, but there was an error of an extra End token at the end. I took that out, now the program gives an error at the same place, but only when attempting to rotate off the board.


Code:
{0,0,0,0,0,0,0->|LTPD
If 7>|LCPD(7:Then
For(I,0,2
~|LCPD(2I+1)->|LTPD(2I+2
|LCPD(2I+2)->|LTPD(2I+1
End
DelVar RFor(I,0,2 //SYNTAX ERROR HERE (DelVar) WHEN ROTATING AGAINST WALL
If A+|LTPD(2I+1)>10 or A+|LTPD(2I+1)<1 or B-|LTPD(2I+2)>20 or B-|LTPD(2I+2)<1 or [A](B-|LTPD(2I+2),A+|LTPD(2I+1
1->R
End
If not(R:Then
For(I,0,2
Pt-Off(~1+3(A+|LCPD(2I+1)),62-3(B-|LCPD(2I+2)),2)
End
For(I,1,6)
|LTPD(I)->|LCPD(I):End
For(I,0,2)
Pt-On(~1+3(A+|LCPD(2I+1)),62-3(B-|LCPD(2I+2)),2)
End
End
So weird. For fun, can you please pass the resulting .8xp through SourceCoder and post the phpBB code that it generates here?
BASIC Code wrote:
:{0,0,0,0,0,0,0→∟TPD
:If 7>∟CPD(7:Then
:For(I,0,2
:‾∟CPD(2I+1)→∟TPD(2I+2
:∟CPD(2I+2)→∟TPD(2I+1
:End
:DelVar RFor(I,0,2
:If A+∟TPD(2I+1)>10 or A+∟TPD(2I+1)<1 or B-∟TPD(2I+2)>20 or B-∟TPD(2I+2)<1 or [A](B-∟TPD(2I+2),A+∟TPD(2I+1
:1→R
:End
:If not(R:Then
:For(I,0,2
:Pt-Off(‾1+3(A+∟CPD(2I+1)),62-3(B-∟CPD(2I+2)),2)
:End
:For(I,1,6)
:∟TPD(I)→∟CPD(I):End
:For(I,0,2)
:Pt-On(‾1+3(A+∟CPD(2I+1)),62-3(B-∟CPD(2I+2)),2)
:End
:End
Generated by SourceCoder, © 2005-2012 Cemetech


What did you expect to understand from that?
I expected to use it to see if Tokens was mis-encoding one of the tokens, and generating that mysterious syntax error. As far as I can tell, that was not the case. I don't suppose putting the DelVar R and the For(I,0,2 on separate lines makes a difference?
The syntax error moves on to the For(I,0,2 line. [at the "For("] This remains true only when rotating off the edges (which shouldn't be possible anyway), it works fine if there are no edges in the way.
LiquidMetal wrote:
The syntax error moves on to the For(I,0,2 line. [at the "For("] This remains true only when rotating off the edges (which shouldn't be possible anyway), it works fine if there are no edges in the way.
I'm sufficiently confused that I'm willing to spend a few minutes delving into this myself. Would you mind emailing me a zip of the current component programs?
I sent it, good luck Wink.
LiquidMetal wrote:
I sent it, good luck Wink.
I tested it. Wait a second, it doesn't trigger a Syntax error, it triggers a Dimension error. That's a big difference! Unless you disagree?
I'm pretty sure it was a syntax error... Unless dcs7 doesn't differentiate?

EDIT: It does seem to be a DIM error now... I think it has something to do with the or statements you made me un-ifelse. Why would the pointer land on I,0,2?

EDIT: Is it possible that it was a Syntax error last time?
It is very unlikely that it changed from a SYNTAX to DIM error arbitrarily. I can only assume that (2I+1) or (2I+2) is out of bounds now. You basically need to not make those list accesses if they're going to be out-of-bounds, which you should be able to do detect. Essentially:


Code:
If 2I+1<=Something
Then
If A+∟TPD(2I+1)>10 or A+∟TPD(2I+1)<1
1->R
If 2I+2<=Something
Then
If B-∟TPD(2I+2)>20 or B-∟TPD(2I+2)<1
1->R
If [A](B-∟TPD(2I+2),A+∟TPD(2I+1
1->R
End
End
I saw your reply (Tetris 3.0), and I thought I already did something about that, but I must have lost it in one of the compilations. I'll be on a lot less frequently now, because of school work :'(, but I'll try to check what values are coming up within that loop and prevent those values from reaching there when I get a chance. Thank you!
LiquidMetal wrote:
I saw your reply (Tetris 3.0), and I thought I already did something about that, but I must have lost it in one of the compilations. I'll be on a lot less frequently now, because of school work :'(, but I'll try to check what values are coming up within that loop and prevent those values from reaching there when I get a chance. Thank you!
Sound good, good luck. Hopefully you'll still be able to stop by relatively frequently. But you get the general technique I'm using to avoid those dimension errors?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement