Re: Return from nested subroutines (still goto discussion)
- Posted by Patrick Barnes <mrtrick at gmail.com> Nov 12, 2004
- 536 views
On Fri, 12 Nov 2004 15:09:11 +0800, aku saya <akusaya at gmx.net> wrote: > > Code.. > (I used to use this in PASCAL long time ago) <SNIP> > > When main() is executed, it will call r(1), r(1) will call r(2), etc, > r(4) will call r(5), r(5) will print "success" and then goto ok which > will print "program end" without no printing of "don't come here!" > > That is the very convenient use of goto, and I used goto only on > programs like that. > > Is there any method to perform the same as above without goto and > without decreasing performance? uh.... for i = 1 to 5 do *code* end for puts(1, "success\n") puts(1, "program end\n") Gives the same output, and runs some section of code 5 times? -- MrTrick