Loop with DO or with GOTO Main?
John Kauffman
Posts: 653
In the situation where an entire program runs continuosly, I have seen two options in the literature:
1 - Put the whole program in a DO ... LOOP inside Main:
2 - Use the Main: ... GoTo Main commands in the template
Both work.
Is there any difference (practical or theoretical) between the two practices?
Thanks.
1 - Put the whole program in a DO ... LOOP inside Main:
2 - Use the Main: ... GoTo Main commands in the template
Both work.
Is there any difference (practical or theoretical) between the two practices?
Thanks.
Comments
Theoretically, the DO ... LOOP structure is better in that
1) there's no label needed that may be purely arbitrary (a placeholder only)
2) the structure explains what is intended. Using a label and a GOTO may be part of some more
complex program flow or it just might be a way to implement a DO ... LOOP. You can't tell
without examining the whole program (for another GOTO Main).