|
-
Jun 6th, 2007, 01:03 PM
#1
Thread Starter
Hyperactive Member
How do you exit sub in Java
In vb you can say
Code:
if filename = "" then exit sub
and that will stop the function from executing more code, how can I do the same in java?
Here is what I got so far but its not compiling
Code:
private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String filename=jTextArea1.getText();
if filename = "" then return;
}
What do i have to put instead of 'return'?
-
Jun 6th, 2007, 01:09 PM
#2
Re: How do you exit sub in Java
The return keyword will do exactly the same as Exit Sub in VB
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 6th, 2007, 01:12 PM
#3
Re: How do you exit sub in Java
And by the way:
vb Code:
if filename = "" then return;
Oh my god
It's:
Code:
if( filename.equals("") ) return;
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 6th, 2007, 01:46 PM
#4
Thread Starter
Hyperactive Member
Re: How do you exit sub in Java
lol, I accidentally put 'then' , java doesn't use then. Its gonna be hard getting used to Java again. Thanx brotha
-
Jun 10th, 2007, 10:20 PM
#5
PowerPoster
Re: How do you exit sub in Java
Never mind. Correct it right now. It is good to see pal.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|