home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / ADDPATH.MOD < prev    next >
Text File  |  1988-01-07  |  2KB  |  45 lines

  1. (*----------------------------------------------------------------------*)
  2. (*             Add_Path --- Add path to file spec if necessary          *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Add_Path( VAR File_Name      : AnyStr;
  6.                     VAR Path           : AnyStr;
  7.                     VAR Full_File_Name : AnyStr  );
  8.  
  9. (*----------------------------------------------------------------------*)
  10. (*                                                                      *)
  11. (*     Procedure: Add_Path                                              *)
  12. (*                                                                      *)
  13. (*     Purpose:   Adds path to file name if not already present.        *)
  14. (*                                                                      *)
  15. (*     Calling Sequence:                                                *)
  16. (*                                                                      *)
  17. (*        Add_Path( VAR File_Name      : AnyStr;                        *)
  18. (*                  VAR Path           : AnyStr;                        *)
  19. (*                  VAR Full_File_Name : AnyStr  );                     *)
  20. (*                                                                      *)
  21. (*----------------------------------------------------------------------*)
  22.  
  23. VAR
  24.    MyPath : AnyStr;
  25.    L      : INTEGER;
  26.  
  27. BEGIN (* Add_Path *)
  28.  
  29.    MyPath := Path;
  30.  
  31.    L := LENGTH( Mypath );
  32.  
  33.    IF ( L > 0 ) THEN
  34.       IF ( MyPath[L] <> ':' ) THEN
  35.          IF ( MyPath[L] <> '\' ) THEN
  36.             MyPath := MyPath + '\';
  37.  
  38.    IF ( POS( '\' , File_Name ) = 0 ) AND
  39.       ( POS( ':' , File_Name ) = 0 ) THEN
  40.       Full_File_Name := MyPath + File_Name
  41.    ELSE
  42.       Full_File_Name := File_Name;
  43.  
  44. END   (* Add_Path *);
  45.