title: How to return to the main program from a Pascal procedure?
body: <p>how do i back from procedure to my main program?</p>
  <p>here my procedure :</p>
  <pre><code>procedure sort_data;
  var
     i, j, imin: integer;
     temp: TGame;
  begin
     writeln('Begin Sorting : ');
  
     for i := 1 to dataa - 1 do
     begin
        imin := i;
  
        for j := i + 1 to dataa do
        begin
           if data[imin].price &gt; data[j].pricec then
              imin := j;
        end;
  
        temp := data[i];
        data[i] := data[imin];
        data[imin] := temp;
     end;
  
     writeln('Sorting Success, press ENTER');
     readln();
  end;
  </code></pre>
  <p>and everytime i done with that procedure, the app always gone exit.
  I want to back to the main program everytime the procedure finished</p>
  <p>here is my main program:</p>
  <pre><code>begin
     dataa:=0;
       
     textcolor(lightred);
     gotoxy(32,  3); writeln('DAJUNs Game Store');
     TextColor(White);
     gotoxy(26,6);writeln('* Admin View *');
     gotoxy(26,  7); writeln('----------------------------');
     gotoxy(29,  8); writeln('1. Show Data');
     gotoxy(29,  9); writeln('2. Add Data');
     gotoxy(29, 10); writeln('3. Search Data');
     gotoxy(29, 11); writeln('4. Delete data');
     gotoxy(29, 12); writeln('5. Edit data');
     gotoxy(29, 13); writeln('6. Sorting Data');
     gotoxy(29, 14); writeln('7. Filter data');
     gotoxy(29, 15); writeln('0. Exit APP');
     gotoxy(26, 16); writeln('----------------------------');
  
     menu := readkey;
  
     case menu of
        #49 : show_data;
        #50 : add_data;
        #51 : search_data;
        #52 : delete_data;
        #53 : edit_data;
        #54 : sort_data;
        #55 : search_data;
        #48 : exit;
        else writeln('You presses other key that not belongs here');
     end;
  end.
  </code></pre>
  <p>so what should i add in procedure to make my problem solved
  THANKS</p>