|
SOLUTIONS
|
Break::nofunc Continue::nofunc Return::nofunc
DetailsDetails
-
- This message is generated when the optional second argument in Break, Continue, or Return does not match an enclosing function call.
- The second argument in Break, Continue, or Return is a label that specifies the enclosing function or loop that will be affected. If this label is omitted, the affected function or loop is determined using built-in heuristics.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Break::nofunc].
ExamplesExamplesopen allclose all
Basic Examples (2)Basic Examples (2)
Return is used with two arguments and there are no enclosing functions:
This shows a typical use of Return with two arguments. The second argument is used here to specify that the return should be from the enclosing Module:
| In[2]:= |
Without the second argument in Return, the default is to return from the enclosing Do loop, so the return value of the function will be different:
| In[4]:= |
This shows an incorrect use of the second argument in Return. The function f does not enclose the Return expression and so cannot be used as a return destination.
| In[1]:= |
| In[3]:= |
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »



