![]() |
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
I agree with Alan and James that a problem exists in the use of the assignment operator, but the initial problem stated that the code was stuck in Left. I don't see how this could be reached. How was it determined that it was getting stuck in Left?
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
i had a student telling me what directions the wheels were turning and i took his word for it instead of double checking, but thank you all for the help
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
I still think we need to see the rest of the code, or at least how the time variable is defined. If it isn't defined static, the variable will be re-initialized everytime its host entity is restarted. So if it's at the top of your function, and this function runs over and over every loop, it will be reinitialized every loop to 0, no matter how much you increment it. Or, time can be a global and it will retain its value, but if you're assigning 0 to it every loop that will also ruin your day. I think you have a pretty simple (and somewhat hard to notice) problem that I'm unfortunately very familiar with, as Mark McLeod can tell you, how many times did I hit Chris with the robot again? ;)
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
the .c file is attached above, but i know for a fact thats not the problem because ive defined "time" and incrimented it the same way for 3 years now and i have had no problem with that at all.
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
As far as what I meant, I meant that a local variable inside of a function would be reset everytime the function ended and started again. Not sure why I worded it that way, let me just chalk it up to a goofy morning eh? :) |
| All times are GMT -5. The time now is 23:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi