home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / pibterm / pibt41s2.arc / PIBFMANI.MOD < prev    next >
Text File  |  1988-01-17  |  4KB  |  87 lines

  1. (*----------------------------------------------------------------------*)
  2. (*        PibFileManipulation --- File Manipulation for Turbo           *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE PibFileManipulation( VAR File_Done : BOOLEAN;
  6.                                VAR Do_Editing: BOOLEAN;
  7.                                VAR Do_Viewing: BOOLEAN );
  8.  
  9. (*----------------------------------------------------------------------*)
  10. (*                                                                      *)
  11. (*     Procedure:  PibFileManipulation                                  *)
  12. (*                                                                      *)
  13. (*     Purpose:    Central control routine for file manipulation        *)
  14. (*                                                                      *)
  15. (*     Calling Sequence:                                                *)
  16. (*                                                                      *)
  17. (*        PibFileManipulation( VAR File_Done : BOOLEAN;                 *)
  18. (*                             VAR Do_Editing: BOOLEAN;                 *)
  19. (*                             VAR Do_Viewing: BOOLEAN );               *)
  20. (*                                                                      *)
  21. (*           File_Done  --- TRUE if through with file manipulation      *)
  22. (*           Do_Editing --- TRUE to do editing                          *)
  23. (*           Do_Viewing --- TRUE to do viewing                          *)
  24. (*                                                                      *)
  25. (*     Calls:                                                           *)
  26. (*                                                                      *)
  27. (*     Remarks:                                                         *)
  28. (*                                                                      *)
  29. (*        This routine exists to centralize file manipulation so that   *)
  30. (*        the Turbo Pascal overlay scheme will work.                    *)
  31. (*                                                                      *)
  32. (*----------------------------------------------------------------------*)
  33.  
  34. VAR
  35.    File_Menu     : Menu_Type;
  36.    I             : INTEGER;
  37.    Done_Files    : BOOLEAN;
  38.  
  39. BEGIN (* PibFileManipulation *)
  40.                                    (* Get file manipulation menu *)
  41.  
  42.    Make_A_Menu( File_Menu, 10, 10, 30, 0, 0, 10,
  43.                 'Choose file function: ',
  44.                 'A)ctive directory change;C)opy file;D)irectory display;' +
  45.                 'E)dit file;F)ree space on drive;L)ogged drive change;'   +
  46.                 'P)rint a file;V)iew a file;Z)ap (delete) file;Q)uit;',
  47.                 FALSE );
  48.  
  49.    Done_Files := FALSE;
  50.    Do_Editing := FALSE;
  51.    Do_Viewing := FALSE;
  52.  
  53.    REPEAT
  54.  
  55.       Menu_Display_Choices( File_Menu );
  56.       I := Menu_Get_Choice( File_Menu , Erase_Menu );
  57.  
  58.       IF ( I < 0 ) THEN
  59.          I := 10;
  60.  
  61.       CASE I OF
  62.          1:  Change_Subdirectory;
  63.          2:  Copy_A_File;
  64.          3:  View_Directory;
  65.          4:  BEGIN
  66.                 Do_Editing := TRUE;
  67.                 Done_Files := TRUE;
  68.              END;
  69.          5:  Find_Free_Space_On_Drive;
  70.          6:  Log_Drive_Change;
  71.          7:  Print_A_File( '' );
  72.          8:  BEGIN
  73.                 Do_Viewing := TRUE;
  74.                 Done_Files := TRUE;
  75.              END;
  76.          9:  Delete_A_File;
  77.         10:  Done_Files := TRUE;
  78.         ELSE;
  79.       END (* Case *);
  80.  
  81.    UNTIL Done_Files;
  82.  
  83.    File_Done := NOT ( Do_Editing OR Do_Viewing );
  84.  
  85. END   (* PibFileManipulation *);
  86.  
  87.