Go Down

Topic: For loop not working... FIXED. thank you AWOL (Read 718 times) previous topic - next topic

Inter-Magic

steps is not an array.
Code: [Select]

steps = 15;
    for (int i = 0  ;        i <= steps           ;  i++       ) {
// for (start at 0; if i equals/same DO IT; add 1 to i) {
DO-IT();
}

This is how I understand it. 

I will be making a different post.  Its the original problem....

Dave
Dave
ö¿ö

PaulS

Code: [Select]
// for (start at 0; if i equals/same DO IT; add 1 to i) {
The middle clause is a while clause. Execute the body of the for statement while i is less than or equal steps.

Inter-Magic

thank you PaulS,
I did try <=   >= != and so on.  Here is what i found just minutes ago.
I changed
Code: [Select]
for (int i=0;i<=steps;i++){ to a
Code: [Select]
for(int i=0;i<=TheDelay;i++){ and it works great.

this was just a test but it worked. Is steps a reserved word? it did not turn red.

*TheDelay = 90

Any insight on why?

thanks

Dave
ö¿ö

PaulS

Quote
Is steps a reserved word?

No.

Quote
*TheDelay = 90

What does this mean? How is TheDelay declared?

Quote
Any insight on why?

On why what? You changed the code you initially posted, but haven't shown us the changed code. You can't reasonably expect us yo answer questions about code we can't see, can you?

Inter-Magic

Thanks for the response PaulS.

*TheDelay = 90 was not in a code window.  So its not code. I was letting viewers know TheDelay equaled 90.
as for not showing the changes. Posted on: December 25, 2012, 03:04:40 PM
Quote
Code: [Select]
for(int i=0;i <= steps;i++){


Then i stated i was having a different problem. (well it was the first problem i did not post until now but was the main problem.)
Quote
I will be making a different post.

So i hope this clears thing up for you.

This question was answered.

Dave
ö¿ö

Go Up