?
Solved

Closing a Sub

Posted on 1998-10-01
6
Medium Priority
?
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 

Accepted Solution

by:
shez earned 240 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

743 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