In the very beginning of my program, I "33->dim(L2", then later on I try to store variables into slots 25-31, but I keep getting a "dim" error. I've checked on the homescreen and it says dim(L2)=33, and the variables I'm storing are definitely above 0, so I don't understand how I could be getting a "dim" error. Can anyone please explain? Thanks.
Can you give me a sample of one or two of the storage statements that have errors?

Code:
1->L2(25
S->L2(26
L->L2(27
M->L2(28


The variables are all positive integers.
The variables can be positive or negative, integers, floating, or even complex, but I wanted to see how you were specifying the list indices. Namely, I wanted to see if you were using constant indices or variables that might have the annoying 12th-place rounding problem. I must say, I'm stumped. Can you show me the exact line where the error occurs, or is it the first one there?
It's all of them - if I completely deletethe first line, the error just shows up one line down.
Beta7 wrote:
It's all of them - if I completely deletethe first line, the error just shows up one line down.
And you're definitely using the big-L-little-2 (SourceCoder's {L2}) everywhere, correct? Can you stick a Pause dim(L2) statement right before those and see what it says?
Yeah - just can't easily make them on a phone. Razz

After inserting that Pause, it said "21". Now I guess I get to go track down why L2 is being reduced from 33 to 21.

Sorry for wasting your time (when you should probably be sleeping Razz).
Haha, thanks for acknowledging it, but I'd probably be up anyway. Smile Check for storing to the dim() of the list somewhere, or even replacing it with another list by accident. I'll hope to see your progress in the morning; good night!
Found it - when I said to start a new game, I was only loading 21 values into L2 (tried to save space by not listing out the last 8 0's).

Why does it reduce L2 just because I don't say to store the extra 0's (when they're already there from setting the list up at 33 slots)?

*EDIT* Now I'm getting DIM errors when I try to show text, but my x/y min/max are what they are supposed to be (0/0/94/62) and I'm posting inside of that range. It posts the info the first time through, but when I loop back to fight again, it crashes.
Again, make a collection of what variables are involved at that moment and see what their values are, versus what they ought to be. Your observations are basically personal narratives if they don't contain enough information for us to help you discern the cause.
KermMartian wrote:
Haha, thanks for acknowledging it, but I'd probably be up anyway. Smile Check for storing to the dim() of the list somewhere, or even replacing it with another list by accident. I'll hope to see your progress in the morning; good night!


The only progress I've made is to screw up more of my code. Sad


Weregoose, there are no variables involved in the text output, other than xmin/xmax/ymin/ymax, and those are all the expected values.
The solution therefore is that it's the text you're showing, not the location of the text. Text offscreen does not cause a Dimension error; if I recall correctly it causes a Domain error. Therefore, you must be displaying element(s) from a list that are outside the bounds of the given list. Regarding your earlier question about why storing 21 elements resizes the list: when you do things like 3->L2(22), you're storing to a single element. When you do {3,4,71,45,3->L2, you are creating a new five-element list, deleting L2, and replacing L2 with your new five-element list. Replacement (obviously) resizes the list.
Thanks for clearing that up.

The line reads :Text(0,25,"Battle!

What's weird is that it runs through it once, displaying everything properly, then goes back to the top (instead of executing :If Str1=/=" ":prgmHALOBAT2) and crashes.
Are you positive that that's the line at fault, then?
What else could it be if it stops on the T in "Text("?

And what does "Error 515.....TYP" mean? That error is showing up on the T in the first Text command in another program.

Thanks for the assistance!
Beta7 wrote:
What else could it be if it stops on the T in "Text("?

And what does "Error 515.....TYP" mean? That error is showing up on the T in the first Text command in another program.

Thanks for the assistance!
It means Data Type. Regarding stopping on the T in Text(), that doesn't really mean anything at all. Can you post the code in question with a few lines of context on either side?
I'll upload the entire game once I get home, and post the code for the problem areas then (should be about 2 hours Sad ).
Beta7 wrote:
I'll upload the entire game once I get home, and post the code for the problem areas then (should be about 2 hours Sad ).
Sounds good, I look forward to seeing what you have.
This is the code I'm having problems with (at least, this is where all the errors lead to):

HALOEVEN (Event checker)

Code:
:If S=1:Then
:If L=1 and M=2 and T=9:Then
:ClrDraw
:Text(15,1,Str2," found a bonus supply stash!
:Text(25,1,Str2," stocked up on ammo.
:Pause
:ClrDraw
:L2(6→L2(5
:L2(8→L2(7
:L2(10→L2(9
:L2(12→L2(11
:L2(14→L2(13
:L2(16→L2(15
:L2(18→L2(17
:L2(20→L2(19
:End
:If (L=2 and M=3 and T=26 and sub(Str4,T,1="H")):Then
:Text(15,1,Str2," found a health pack!
:Pause
:100→L2(1
:100→L2(2
:End
:If (L=3 and M=1 and T=76 and sub(Str4,T,1="P")):Then
:ClrDraw
:Text(15,1,"This is a side
:Text(25,1,"portal that takes you
:Text(35,1,"back to the start (to
:Text(45,1,"get you untrapped)
:Pause
:ClrDraw
:5→Q:12→P:1→L:2→M:76→T:prgmHALOMAPS
:End
:If (L=3 and M=3 and T=31 and sub(Str4,T,1="G")):Then
:ClrDraw
:Text(15,1,Str2," escaped the
:Text(25,1,"Pillar of Automn!
:Pause
:ClrDraw
:Text(5,1,"(Escape pod hisses open)
:Text(15,1,"Cortana:
:Pause
:2→S
:3→L
:2→M
:7→Q
:15→P
:111→T
:prgmHALOMAPS
:End
:End
:If S=2:Then
:If (L=3 and M=1 and T=79):Then
:ClrDraw
:Text(5,1,"Sergeant Johnson: Hey, it's Master Chief!
:Pause
:End
:If (L=3 and M=1 and T=19):Then
: //Change map
:Output(1,1,Str4
:End
:If (L=1 and M=1 and T=69 and sub(Str4,T,1="S")):Then
: //Change map
:Output(1,1,Str4
:End
:If (L=1 and M=1 and T=101 and sub(Str4,T,1="S")):Then
:  //Change map
:Output(1,1,Str4
:End
:ClrDraw
:If (L=2 and M=2 and T=67):Then
:ClrDraw
: //Talk
:Pause
:End
:If sub(Str4,T,1="M":Then
:ClrDraw
: //Talk
:Pause
:ClrDraw
:End
:If L=1 and M=3 and T=97:Then
:ClrDraw
: //Talk
:Pause
:Text(25,0,"Let's get out of here.
:Pause
:3→S
:"?→L
:"?→M
:"?→Q
:"?→P
:"?→T
:End
:End



*Edit* After going through and removing all of my "sub()" commands, the event checker worked fine, which indicates I messed up the sub() command. How does it work?
sub() creates a substring from a string. The syntax for sub() is sub(String,Start,Length). For example, sub("CEMETECH",1,Cool yields "CEMETECH", sub("CEMETECH",5,4) yields "TECH", and sub("CEMETECH",3,2) yielded "ME".
  
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 4 of 5
» 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