Exit from if statement and loop back to int start()

Back to topics list To post a new topic, please log in or register
avatar
80
chuale 2015.07.31 11:52
 
1: int start()
2: { 
3:
4: if( code 1)
5:   {
6:
7:    if (code 2) 
8:     {
9:      code 3;
10:     code 4;
11:     return(0);
12:    }
13:     
14:   if (code 5) 
15:    {
16:    code 6;
17:    code 7;
18:    return (0);
19:    }
     
return(0)
     }

Hello,

  

How can I loop back to int start() after line 12  if the condition is right without executing the subsequent lines? Does the return(0) in line 11 loop back to int start()? Thank you.  

 

avatar
1109
Ovo 2015.07.31 13:05 #
 
Not sure at all if you do understand what you are doing, but typing
start();
on the line 13 would jump to the line 1.
avatar
12995
WHRoeder 2015.07.31 13:48 #
 
chuale: Does the return(0) in line 11 loop back to int start()?

Returning from start goes to the terminal. Then when a new tick arrives, start is called again.

You do not want to recursively call start.

Back to topics list  

To add comments, please log in or register