Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] return from nested function?

jhallman

2005-02-25

Replies:

Is is possible from within a function to cause its caller to return()?

I have a function that lets user make edits to certain objects, and then
checks that the edited objects still make sense. If they don't, the function
puts up a notifier that the edits are being discarded and then returns,
something like:

 if(badEdits){
    notifyDialog("bad edits will be ignored")
    return()
 }
 else {
  ## some stuff that assigns the edited objects in the calling frame
   return()
 }

This works, but I'd really like to put the return() in the notifyDialog()
function. Is there an easy way to do this?

Jeff

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.