1. ver 4.0 goto ?
- Posted by bernie Sep 10, 2008
- 1084 views
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
2. Re: ver 4.0 goto ?
- Posted by bernie Sep 11, 2008
- 1005 views
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
64 user's have read this post but nobody has responded to it.
3. Re: ver 4.0 goto ?
- Posted by CChris Sep 11, 2008
- 935 views
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
64 user's have read this post but nobody has responded to it.
goto can be used anywhere, at your own risks. Its target is limited to the current routine, or the current file if outside any routine.
Syntax is:
goto "label string"
where a label is defined by the
label "label strng"
statement.
Header labels do not count as possible goto llabel targets.
Use goto in production code when amllthe following applies:
- You want to proceed with a statement which is not the followin one;
- the various structured constructs wouldn't do, or very awkwardl;
- you contemplate a significant gain in speed/reliability;
- the code flow remains understandable for an outsider.
Otherwise, at early development, it may be nice to have while the code isn't firmly structured. But most instances of it should melt into structured constructs as soon as possible.
I am aware of at least two sorts of use for it:
- A routine has several return statements, and some processing must be done before returning, no matter from where. It may be clearer to goto a single return point and perform the processing only at this point.
- An exit statement in a loop corresponds to an early exxit, and the normal pocessing that immediately follows the loop is not relevant. Replacing an exit statement followed by various flag testing by a single goto can help.
Explicit label names will tremendously help maintenance.
If gotoing into a scope (an if block, a for loop,...) will just do that. Some variables may be defined only in that scope, and they may or may not have sensible values. As mentioned above, it is at your own risk.
CChris
4. Re: ver 4.0 goto ?
- Posted by bernie Sep 11, 2008
- 915 views
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
64 user's have read this post but nobody has responded to it.
goto can be used anywhere, at your own risks. Its target is limited to the current routine, or the current file if outside any routine.
Syntax is:
goto "label string"
where a label is defined by the
label "label strng"
statement.
Header labels do not count as possible goto llabel targets.
Use goto in production code when amllthe following applies:
- You want to proceed with a statement which is not the followin one;
- the various structured constructs wouldn't do, or very awkwardl;
- you contemplate a significant gain in speed/reliability;
- the code flow remains understandable for an outsider.
Otherwise, at early development, it may be nice to have while the code isn't firmly structured. But most instances of it should melt into structured constructs as soon as possible.
I am aware of at least two sorts of use for it:
- A routine has several return statements, and some processing must be done before returning, no matter from where. It may be clearer to goto a single return point and perform the processing only at this point.
- An exit statement in a loop corresponds to an early exxit, and the normal pocessing that immediately follows the loop is not relevant. Replacing an exit statement followed by various flag testing by a single goto can help.
Explicit label names will tremendously help maintenance.
If gotoing into a scope (an if block, a for loop,...) will just do that. Some variables may be defined only in that scope, and they may or may not have sensible values. As mentioned above, it is at your own risk.
CChris
Thank You for the information.
I recommend that your description be added to the manual.
5. Re: ver 4.0 goto ?
- Posted by ghaberek (admin) Sep 11, 2008
- 934 views
Thank You for the information.
I recommend that your description be added to the manual.
I concur, though sans typos.
-Greg
6. Re: ver 4.0 goto ?
- Posted by mattlewis (admin) Sep 11, 2008
- 915 views
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
64 user's have read this post but nobody has responded to it.
goto can be used anywhere, at your own risks. Its target is limited to the current routine, or the current file if outside any routine.
Syntax is:
goto "label string"
where a label is defined by the
label "label strng"
statement.
Header labels do not count as possible goto llabel targets.
Use goto in production code when amllthe following applies:
- You want to proceed with a statement which is not the followin one;
- the various structured constructs wouldn't do, or very awkwardl;
- you contemplate a significant gain in speed/reliability;
- the code flow remains understandable for an outsider.
Otherwise, at early development, it may be nice to have while the code isn't firmly structured. But most instances of it should melt into structured constructs as soon as possible.
I am aware of at least two sorts of use for it:
- A routine has several return statements, and some processing must be done before returning, no matter from where. It may be clearer to goto a single return point and perform the processing only at this point.
- An exit statement in a loop corresponds to an early exxit, and the normal pocessing that immediately follows the loop is not relevant. Replacing an exit statement followed by various flag testing by a single goto can help.
Explicit label names will tremendously help maintenance.
If gotoing into a scope (an if block, a for loop,...) will just do that. Some variables may be defined only in that scope, and they may or may not have sensible values. As mentioned above, it is at your own risk.
CChris
Thank You for the information.
I recommend that your description be added to the manual.
Me too.
In the documents there is no explanation or examples of how to use goto and exactly where it can be used. quoting the manual: "The following flow control keywords are available." "break retry entry exit continue return goto end" Where is it used ( in which flow control statement ? ) and how is it used ?
64 user's have read this post but nobody has responded to it.
goto can be used anywhere, at your own risks. Its target is limited to the current routine, or the current file if outside any routine.
Syntax is:
goto "label string"
where a label is defined by the
label "label strng"
statement.
Header labels do not count as possible goto llabel targets.
Use goto in production code when amllthe following applies:
- You want to proceed with a statement which is not the followin one;
- the various structured constructs wouldn't do, or very awkwardl;
- you contemplate a significant gain in speed/reliability;
- the code flow remains understandable for an outsider.
Otherwise, at early development, it may be nice to have while the code isn't firmly structured. But most instances of it should melt into structured constructs as soon as possible.
I am aware of at least two sorts of use for it:
- A routine has several return statements, and some processing must be done before returning, no matter from where. It may be clearer to goto a single return point and perform the processing only at this point.
- An exit statement in a loop corresponds to an early exxit, and the normal pocessing that immediately follows the loop is not relevant. Replacing an exit statement followed by various flag testing by a single goto can help.
Explicit label names will tremendously help maintenance.
If gotoing into a scope (an if block, a for loop,...) will just do that. Some variables may be defined only in that scope, and they may or may not have sensible values. As mentioned above, it is at your own risk.
CChris
Thank You for the information.
I recommend that your description be added to the manual.
7. Re: ver 4.0 goto ?
- Posted by euphoric (admin) Sep 11, 2008
- 930 views
Me too.
Matt, you are evil.