strange issue - while and if issues

 

friends, i have wrote a bunch of code and now i trying to capture it in a while loop... - which it doesn't work. too much code (more than 2000 code lines) throws off the while loop ? it is OnStart().

the code has a bunch of lines in a for loop and if i put a if condition after that - with too many conditions - is not working either...

i am in serious need for help. the code compiles correctly... but is not working for the while and if conditions...


if i can speak with someone on private i would be glad too... public answer works as well.


i think my question is if too many code lines may affect the execution of the while loop... or the ifs are affected by too many conditions...

While (1==1) - or while (1>0) - i need the loop to just run all the time... and yes, it was working with less code... after I have placed more code - it stopped working.

appreciated dear friends...

 
CB: i think my question is if too many code lines may affect the execution of the while loop... or the ifs are affected by too many conditions...

No and no.

 
 I have changed my password but did not received the code
 
Faqiryajmal: I have changed my password but did not received the code
@Faqiryajmal Don't hijack other peoples threads with your off topic posts.
 
William Roeder:

No and no.

hmm... then what can go wrong ? should I use a different location than OnStart() ? 
 
CB:

... - which it doesn't work. too much code (more than 2000 code lines) throws off the while loop ? 

CB:
hmm... then what can go wrong ? should I use a different location than OnStart() ? 

You probably need to be more specific... What exactly is "doesn't work"? Did it Crash? Any error message? Or just hang there?

One very common issue with while loop is the end condition - make sure you have one that will become true at some point in time...

 
Seng Joo Thio:

You probably need to be more specific... What exactly is "doesn't work"? Did it Crash? Any error message? Or just hang there?

One very common issue with while loop is the end condition - make sure you have one that will become true at some point in time...

While (1==1) - or while (1>0) - i need the loop to just run all the time... and yes, it was working with less code... after I have placed more code - it stopped working.


hope this answers... not sure what to do...

 
CB:

While (1==1) - or while (1>0) - i need the loop to just run all the time... and yes, it was working with less code... after I have placed more code - it stopped working.

hope this answers... not sure what to do...

LOL... I still don't know what you mean by 'doesn't work'... If you seriously want a solution, and if you really don't want to share your code here, feel free to private message me - I'll try to help you figure out what could be wrong. 
 
A loop body with 2000 lines is difficult to read and maintain. Even if only you are going to use it and no one else participates. Think what will happen when you didn't work with this code for half a year and then come back to reuse it. It would be much easier to maintain if you break the block into smaller pieces and make functions from it. Btw 'while(true)' is commonly used.
 
CB: While (1==1) - or while (1>0) - i need the loop to just run all the time...

Why? Nothing is changing. Return from OnTick/OnCalculate and wait to be called when something does change.

 
lippmaje:
A loop body with 2000 lines is difficult to read and maintain. Even if only you are going to use it and no one else participates. Think what will happen when you didn't work with this code for half a year and then come back to reuse it. It would be much easier to maintain if you break the block into smaller pieces and make functions from it. Btw 'while(true)' is commonly used.
appreciated. i think this is the path. but otherwise the code is simple for me to get even after 1 year away from it... (or am i that smart ? no... is really simple).
Reason: