Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exit procedure 1

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Is there a way to exit a procedure? In Delphi I can do something like:

Code:
[navy][i]// for automatic syntax highlighting see faq102-6487 
[/i][/navy][b]procedure[/b] TForm1.Button1Click(Sender);
[b]begin[/b]
  [b]if[/b] booSomething [b]then[/b]
  [b]begin[/b]
    [navy][i]//some code
[/i][/navy]    Exit; <- Exits the [b]procedure[/b] without executing [teal]'even more code'[/teal]
  [b]end[/b]
  [b]else[/b]
   [navy][i]//some other code
[/i][/navy]  [b]end[/b];

  [navy][i]//even more code
[/i][/navy][b]end[/b];

I'd like to duplicate the Exit line in this section of Java:
Code:
private void ProcessDocketing (String ChargeSeq ){
  if (IsDimissed(ChargeSeq)){
	DismissCharge(ChargeSeq);
        [b]NowExitprocedure[/b]
  }

  if (IsReduced(ChargeSeq)){
	ReduceCharge(ChargeSeq);
  }		
}

Thanks for any insight! I've found the Break command, but that only Breaks a for loop, right? I've seen System.Exit, but that appears to exit the application and I don't want to do that.

Leslie

In an open world there's no need for windows and gates
 
ok, i'll give it a shot, but since the return is void, will that work?
 
return; should work.

return null; will give a compiler error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top