title: tcl: stop proc from continue
body: <p>I wrote a script that need to work inside tool.
  When sourcing the file I want &quot;checker&quot; proc will drop the entire sourcing if $current &gt; $exp
  The problem is a inner command inside the tool call &quot;exit&quot; and this command cause tool to exit.
  How can I implement it?
  I tried instead of &quot;exit&quot; use &quot;error&quot; but it print additional errors and don't stop my script clearly.</p>
  <pre><code>proc checker {} {
      set current 100
      set exp 50
      if {${current} &gt; ${exp}} {
          exit
      }
  }
  
  checker 
  
  puts &quot;done!!&quot;
  </code></pre>