home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l291 / 6.ddi / DEMOEXEC.FO$ / DEMOEXEC.bin
Encoding:
Text File  |  1989-02-23  |  980 b   |  38 lines

  1. CC       DEMOEXEC.FOR - Demonstration program for calling C system and
  2. CC       spawnp library functions. These functions are included in the
  3. CC       FORTRAN library. They are discussed in Chapter 3 of the Advanced
  4. CC       Topics manual.
  5. CC
  6. CC       To compile and link DEMOEXEC.FOR type the command:
  7. CC
  8. CC              FL DEMOEXEC.FOR
  9.  
  10. C
  11. C       Include file containing interfaces for system and spawnlp.
  12. C
  13.  
  14. $INCLUDE: 'EXEC.FI'
  15.  
  16. C
  17. C       Declare return types
  18. C
  19.         INTEGER*2 SYSTEM, SPAWNLP
  20.  
  21. C
  22. C       Invoke COMMAND.COM with the command line:
  23. C
  24. C               dir *.for
  25. C
  26.         I = SYSTEM( 'dir *.for'C )
  27.         IF( I .EQ. -1 ) STOP 'Could not run COMMAND.COM'
  28.  
  29. C
  30. C       Invoke a child process:
  31. C
  32. C               EXEHDR DEMOEXEC.EXE
  33. C
  34.         I = SPAWNLP( 0, LOC( 'exehdr'C ), LOC( 'exehdr'C ),
  35.      +                  LOC( 'demoexec.exe'C ), INT4( 0 ) )
  36.         IF( I .EQ. -1 ) STOP 'Could not spawn EXEHDR program'
  37.         END
  38.