home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / fortran / 4937 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.1 KB  |  33 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mlb.semi.harris.com!travis.csd.harris.com!grouper!grouper!brent
  3. From: brent@ssd.csd.harris.com (Brent Benson)
  4. Subject: Re: HELP: calling c from fortran 77
  5. Organization: Harris Computer Systems
  6. Date: Fri, 8 Jan 1993 13:58:10 GMT
  7. Message-ID: <BRENT.93Jan8085810@rcx1.ssd.csd.harris.com>
  8. In-Reply-To: jayas@ee.umanitoba.ca's message of Thu, 7 Jan 1993 23:29:37 GMT
  9. References: <C0IBxD.JL3@ccu.umanitoba.ca>
  10. Sender: news@grouper.mkt.csd.harris.com (Network News)
  11. Lines: 20
  12.  
  13. jayas@ee.umanitoba.ca (Rohitha P. Jayasinghe) writes:
  14.  
  15. > Is it possible to call a C subroutine from fortran 77?  If so, how
  16. > can that be done?
  17.  
  18. That depends on your implementation.  In Harris Fortran 77 you can
  19. declare a function as CEXTERNAL and then call it using %VAL() to pass
  20. arguments by value rather than reference.
  21.  
  22.     cexternal setpriority
  23.     integer*4 setpriority, prio_user, status
  24.     parameter (prio_user=2)
  25.  
  26.     status = setpriority (%val(prio_user), %val(5005), %val(3))
  27.  
  28.  
  29.     
  30. --
  31. Brent Benson                     
  32. Harris Computer Systems
  33.