home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / GETCOMAN.MOD < prev    next >
Text File  |  1988-01-05  |  3KB  |  73 lines

  1. (*----------------------------------------------------------------------*)
  2. (*      Get_Command_Line_Parameters --- Get command line parameters     *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Get_Command_Line_Parameters;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Get_Command_Line_Parameters                          *)
  10. (*                                                                      *)
  11. (*     Purpose:    Gets command line parameters for PibTerm             *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Get_Command_Line_Parameters;                                  *)
  16. (*                                                                      *)
  17. (*----------------------------------------------------------------------*)
  18.  
  19. VAR
  20.    S : AnyStr;
  21.    S2: AnyStr;
  22.    I : INTEGER;
  23.  
  24. (*----------------------------------------------------------------------*)
  25. (*                Fix_Name --- Fix up parameter file name               *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. FUNCTION Fix_Name( FName : AnyStr; FType : AnyStr ) : STRING;
  29.  
  30. BEGIN (* Fix_Name *)
  31.  
  32.    IF ( POS( '.' , FName ) = 0 ) THEN
  33.       FName := FName + '.' + FType;
  34.  
  35.    Fix_Name := UpperCase( FName );
  36.  
  37. END   (* Fix_Parameter_File_Name *);
  38.  
  39. (*----------------------------------------------------------------------*)
  40.  
  41. BEGIN (* Get_Command_Line_Parameters *)
  42.  
  43.                                    (* Loop over command line params *)
  44.    FOR I := 1 TO ParamCount DO
  45.       BEGIN
  46.          S := ParamStr( I );
  47.          IF ( S[1] = '/' ) THEN
  48.             BEGIN
  49.                IF ( S[3] = '=' ) THEN
  50.                   S2    := COPY( S, 4, LENGTH( S ) - 3 )
  51.                ELSE
  52.                   S2 := '';
  53.                CASE UpCase( S[2] ) OF
  54.                   'S':  Script_File_Name     := Fix_Name( S2 , 'SCR' );
  55.                   'C':  Config_File_Name     := Fix_Name( S2 , 'CNF' );
  56.                   'D':  Dialing_File_Name    := Fix_Name( S2 , 'FON' );
  57.                   'E':  Prefix_File_Name     := Fix_Name( S2 , 'PRE' );
  58.                   'K':  Function_Key_Name    := Fix_Name( S2 , 'FNC' );
  59.                   'L':  Log_File_Name        := Fix_Name( S2 , 'LOG' );
  60.                   'P':  IF ( S2[1] IN ['1'..'4'] ) THEN
  61.                            Cmd_Line_Port := ORD( S2[1] ) - ORD( '0' );
  62.                   'T':  Translate_File_Name  := Fix_Name( S2 , 'TRA' );
  63.                   '0':  Debug_Mode           := TRUE;
  64.                   'X':  Use_EMM_For_Overlays := TRUE;
  65.                   ELSE;
  66.                END (* CASE *);
  67.             END
  68.          ELSE
  69.             Script_File_Name    := Fix_Name( S , 'SCR' );
  70.       END;
  71.  
  72. END   (* Get_Command_Line_Parameters *);
  73.