Results 1 to 3 of 3

Thread: procedure help

  1. #1
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question procedure help

    how would i get procedure b to run again right after its called procedure a? if that makes sense. is there a way to break out of a procedure so to speak. i could really use some help on this one.

    example.


    Code:
    program new;
    
    procedure a;
    begin
     wait(100);
      DoStuff;
    end;
    
    procedure b;
    begin
      writeln('stuff');
      z:=  Random(3);
      if(z = 2) then
      procedure a;
    end;
    
    procedure x;
    begin
    end;
    
    begin
      procedure a;
      procedure b;
      procedure x;
    end;

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    To break out of a procedure, you use exit. To break out of a loop (for to do, repeat until, etc) you use break.

    To have procedure b run again after calling procedure a, you can surround the call to procedure b with repeat...until, like this:
    SCAR Code:
    begin
      repeat
        b;
      until(something);
    end.

  3. #3
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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