Results 1 to 2 of 2

Thread: Halting a Procedure

  1. #1

    Halting a Procedure

    Hey guys... How would you halt JUST the current procedure, but continue with the program from where you are?

    IE,
    Code:
    Procedure Exa;
    begin
      if blue <> green then begin
        &#123;...&#125;
      end;
    
      if yellow <> input then begin
        &#123;...&#125;
      end;
    
      if yes = yes then begin
        Writeln&#40;'YES!'&#41;;
        Halt&#40;Exa&#41;; &#123;halt the current procedure...&#125;
        Purple &#58;= 'YES';
      end;
    
      Writeln&#40;'No.'&#41;;
      Writeln&#40;'Is the answer.'&#41;;
      Purple &#58;= 'NO'';
    end;
    
    begin
    Exa;
    Writeln&#40;Purple&#41;;
    end.
    Result:
    YES


    How would I do something like that? (NOTE: that is not real code. AFAIK, it will not work.)
    --MagicRPG--

  2. #2

    Halting a Procedure

    Use the Exit key word. This will exit the current function / procedure and continue from where the procedure was called.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •