![]() |
Running Once?
Where can I put my code so that it will execute itself completely only one time. So, if I turn the bot off and on, it will run again. There was a section in the UserRoutines.c FUNCTION NAME: User_Initialization that says it only runs once, but this doesn't seem like the right place for my code.
|
Re: Running Once?
Make a function somewhere in user_routines.c, put your code in there, and call that function from User_Initialization.
At least if you are trying what I think you are trying to do. |
Re: Running Once?
What is stopping the program from going down the program and calling it, then it hits it again later and runs it? Is this programming language run-by-call-only and not run down the program. Right now I went into the users initialization and just pasted in my code snipet after where it says */Add you own...*/. Looks kind of messy, but only the robot will know :).
|
Re: Running Once?
Quote:
At least it's supposed to... ;) |
Re: Running Once?
Once I call my function, does the function need to link back to the user initialization part just before it left off. I am assuming that it will automatically go back to right after where it was called upon completetion.
|
Re: Running Once?
Quote:
(If you didn't put in a return than the compiler will insert one for you at the end of the functions definition) |
Re: Running Once?
There is a simpler way of having something only run once...
Code:
int counter = 0; |
Re: Running Once?
Quote:
|
| All times are GMT -5. The time now is 10:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi