System commands and command-line args with g77 on Sun 
Author Message
 System commands and command-line args with g77 on Sun

Does anyone have experience using system command and command-line
arguments using fortran with g77 on a Sun workstation?  Any help
will be appreciated.

Using DOS and MS Fortran 5.1 the code was:

1) system commands

      INTERFACE TO INTEGER*2 FUNCTION SYSTEM [C]
     &   (STRING[REFERENCE])
      CHARACTER*1 STRING
      END

      PROGRAM MAIN
      INTEGER*2 I,SYSTEM

      I=SYSTEM("system_command")

      END

   This was useful for spawning an EXE or listing a directory.

2) command line args

      PROGRAM MAIN
      CHARACTER*80 PATHX,INPUT
      INTEGER*2 IP,IPX

      CALL GETARG(0,PATHX,IPX)  ! EXE path
      CALL GETARG(1,INPUT,IP)   ! 1st command-line input

      END


Thanks

Nigel



Sat, 12 Dec 1998 03:00:00 GMT  
 System commands and command-line args with g77 on Sun



Quote:
>Does anyone have experience using system command and command-line
>arguments using Fortran with g77 on a Sun workstation?  Any help
>will be appreciated.

>Using DOS and MS Fortran 5.1 the code was:

> <snip>

>      CALL GETARG(0,PATHX,IPX)  ! EXE path

> <snip>

>Nigel

To aviod problems for MS-users: Note that PATHX will not only give the
path but also the file name (inclusive the extention) of the program.


arguments in different system in the beginning of this month. I don't
know if it yet is added to the FAQ.

Hope this give some help,
Kurt


Department of Building Science, LTH, Lund University, Sweden
<Speaking for myself, not the department, nor ...>



Sun, 13 Dec 1998 03:00:00 GMT  
 System commands and command-line args with g77 on Sun

From yet-unreleased documentation:

 - Intrinsic subroutine: getarg N S
          integer N
          character*(*) S
     Sets S to the N-th command-line argument (or to all blanks if
     there are fewer than N command-line arguments); `call getarg(0,S)'
     sets S to the name of the program (on systems that support this
     feature).  See `iargc' below.

 - Intrinsic subroutine: system CMD RET
          character CMD
          integer RET
     Passes CMD to a shell (see `system(3').  If argument RET is
     present, it contains the value returned by `system(3)'.



Sun, 13 Dec 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Win2000 Gawk Renaming a file with system() command, command line to long

2. gawk 3.1.1/windows command line args problem

3. suppress command line args

4. VisualWorks Command Line Args?

5. ctrl-brk & command line args

6. ctrl-brk & command line args

7. command line args

8. How to access command line args in 80x86?

9. Are program command-line args static under Linux?

10. Command Line args in asm

11. Aonix Activada Command Line Args

12. command line args in ASM program.

 

 
Powered by phpBB® Forum Software