Thanks for responding, but I don't think you understood what I was looking for. This snippet is part of my inventory system in my game. What I was trying to accomplish was not simply printing values. I put the print part in so that you could see that the variables aren't coming out correctly. These are the tohughts I have with the code displayed:
Line 3:order#=order#+1:effect(order#)=1
RINT order#;" e-";effect(order#)
This is the only line that seems to be working. The order# variable is increased by one, making it 0. Then, effect(0) equals one. It is then told to print the order#, which is 0, and then effect(0), which is one. It does this correctly.
Line 4:order#=order#+1:effect(order#)=2
RINT order#;" e-";effect(order#)
This line is a problem, though. I don't get why it doesn't work. This is my understanding of what the line should do:
order# is increased by one, making it 1. Then, effect(1) equals 2. Then it prints order#, which is 1, and effect(1), which is 2.
However, it does not think effect(1) is 2! It prints out something totaly different. The same problem occurs with line 5. The do loop was included simply because the code would not work without a loop. I just decided to put something random in the loop. I tried taking the a=1 out of the loop, but it still messes up.
This is really driving me nuts! Can you please explain to me what is going wrong? Thanks.