Solved

Closing a Sub

Posted on 1998-10-01
6
166 Views
Last Modified: 2013-12-25
I want this to be done:

Sub Hello(var)
...
For each item in DBC do
...
If var2="end" then
     End Sub
End If
Next
...
End Sub

I get an error when it reaches the "End Sub" in the the "If"-statement since it wants a "End If" first. What can I do to skip this?
0
Comment
Question by:EasyQ
  • 3
  • 3
6 Comments
 

Author Comment

by:EasyQ
ID: 1855364
Edited text of question
0
 

Expert Comment

by:shez
ID: 1855365
you may try this:
Sub Hello(var)
    ...
    For each item in DBC do
    ...
    If var2="end" then
         Exit Sub
    End If
    Next
    ...
    End Sub
0
 

Author Comment

by:EasyQ
ID: 1855366
SHAZ. It worked fine! (How could I not know such an easy command) hmm guess it's because I'm self-learned/self-learning. Oh well. If you want your points, just post it as an answer.
As my name says, some thing I ask are EasyQ:s =]


0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Accepted Solution

by:
shez earned 60 total points
ID: 1855367
you may try this:
       Sub Hello(var)
           ...
           For each item in DBC do
           ...
           If var2="end" then
                Exit Sub
           End If
           Next
           ...
           End Sub
0
 

Expert Comment

by:shez
ID: 1855368
everything is easy once you know it.
and i'm also self-learned. :)
0
 

Author Comment

by:EasyQ
ID: 1855369
OK thanx again Shez. And hey, I'm sorry for spelling your name with an "A". Now go answer my other questions =] cya
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question