<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GoTo ??? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303875#M64782</link>
    <description>Sub TestGoto()&lt;BR /&gt;
    GoTo SkipLine&lt;BR /&gt;
    MsgBox "This won't show"&lt;BR /&gt;
SkipLine:&lt;BR /&gt;
    MsgBox "This will show"&lt;BR /&gt;
10  If MsgBox("Again? ", vbOKCancel) = vbCancel Then Exit Sub&lt;BR /&gt;
    GoTo 10&lt;BR /&gt;
End Sub</description>
    <pubDate>Fri, 28 Mar 2003 20:19:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-03-28T20:19:21Z</dc:date>
    <item>
      <title>GoTo ???</title>
      <link>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303874#M64781</link>
      <description>How do I use the GoTo command When I do it I am told that the line numer is not yet defined but I can not figure out how to define the line number.</description>
      <pubDate>Fri, 28 Mar 2003 16:15:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303874#M64781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-28T16:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: GoTo ???</title>
      <link>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303875#M64782</link>
      <description>Sub TestGoto()&lt;BR /&gt;
    GoTo SkipLine&lt;BR /&gt;
    MsgBox "This won't show"&lt;BR /&gt;
SkipLine:&lt;BR /&gt;
    MsgBox "This will show"&lt;BR /&gt;
10  If MsgBox("Again? ", vbOKCancel) = vbCancel Then Exit Sub&lt;BR /&gt;
    GoTo 10&lt;BR /&gt;
End Sub</description>
      <pubDate>Fri, 28 Mar 2003 20:19:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303875#M64782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-28T20:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: GoTo ???</title>
      <link>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303876#M64783</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Please pardon the shout but &lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;NO NO NO&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;DO NOT EVER USE THE GOTO UNLESS YOU ARE ERROR &lt;BR /&gt;
HANDLING.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;off the soapbox&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;ie&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;sub test()&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;on error goto test_error&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim iTest as &lt;BR /&gt;
integer&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iTest = "a"&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;test_error:&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox "Error occured.", &lt;BR /&gt;
vbCritical&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;end sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;or&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;sub test()&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;on error resume next&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim vPt as Variant&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;RETRY:&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vPt = thisdrawing.getpoint (, "Pick point: ")&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if isempty(vpt)=true then goto RETRY&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;end sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;The second example is still a error handler because in the AC world, if a &lt;BR /&gt;
user right clicks (or presses enter) that would be a error. This would catch the &lt;BR /&gt;
'error' condition and not allow the user to exit without making a pick. I do not &lt;BR /&gt;
think that VB still supports line numbers fully. The better way to go is to use &lt;BR /&gt;
a label, as in the first example. Along the opening line, if you goto someplace &lt;BR /&gt;
out of the sub (which you may not be able to) that is the worst programming &lt;BR /&gt;
practice possible. If you need to go outside the sub, with a expected return, &lt;BR /&gt;
just use another sub, or a function. In the first example, after the message &lt;BR /&gt;
box, you could resume next, this would return your code to the next line after &lt;BR /&gt;
the error jump. Be forewarned notice the exit sub before the test_error, if you &lt;BR /&gt;
do not do this, the code in test_error *WILL* be executed. Maybe good, maybe &lt;BR /&gt;
bad. Unfortunately, this is also the only way to handle errors in vb until &lt;BR /&gt;
you(we) move to .net.&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;HTH, and that I was not too harsh.&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;Chris&lt;/DIV&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"bball1525" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:bball1525@yahoo.com"&amp;gt;bball1525@yahoo.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
  &lt;A&gt;&lt;BR /&gt;
  href="news:f1537b8.-1@WebX.maYIadrTaRb"&amp;gt;news:f1537b8.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;How &lt;BR /&gt;
  do I use the GoTo command When I do it I am told that the line numer is not &lt;BR /&gt;
  yet defined but I can not figure out how to define the line &lt;BR /&gt;
number.&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 28 Mar 2003 20:21:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/goto/m-p/303876#M64783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-03-28T20:21:25Z</dc:date>
    </item>
  </channel>
</rss>

