Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

doubt GOTO statment

boobalan_c
Einsteiger
689Aufrufe
pls any one help me.

Iam coverting a fortran system into java.I want to know some thing about GOTO statement.my doubt is from a if loop, i want to jump to a set a statement, so iam providing a GOTO statement there with that particular set of statements line number.after executing the set of statement whether the control send back to the if statement or i will continue the flow after the set of statement.with out any other statament like return or GOTO.

thanks
0 Kudos
3 Antworten
TimP
Geehrter Beitragender III
689Aufrufe
I'm not entirely clear on your question. An example might help. FortranGOTO is not like a BASIC GOSUB. In order for program flow to return to the site of a GOTO, another GOTO would be required. At one time the Fortran standard permitted resumption of a DO loop in this way, but that capability has long since been removed from the standard. As modern compilers have facilities for interprocedural expansion of subroutine calls, there should not be any performance incentive for the kind of code you may be talking about.
Steven_L_Intel1
Mitarbeiter
689Aufrufe
Once you jump out of an IF or DO with a GOTO, you are not allowed to jump back in. The statements you jump to execute normally, there is no "end" other than the end of the program or routine.
If you want some set of statements executed and then control returned, use CALL or a function reference.
boobalan_c
Einsteiger
689Aufrufe
Thanks for your replies. i got my answer from your replies.

thanks you,
boobalan.c
Antworten