!!---------------------------------------------------------------------------- !! !! file : demofact.f90 !! !! version : LF95 5.00 !! !! To use : run mkvcf90.bat !! !!---------------------------------------------------------------------------- !! !! Unpublished - rights reserved under the Copyright Laws of the United States. !! Use, duplication, or disclosure by the Government is subject to restrictions !! as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and !! Computer Software clause at 252.227-7013. !! !! Lahey Computer Systems, Inc. !! PO Box 6091 !! Incline Village, NV 89450 !! voice: 775-831-2500 !! fax: 775-831-8123 !! e-mail: support@lahey.com !! !! Copyright(c) 1994 - 1999, Lahey Computer Systems, Inc. !! !!---------------------------------------------------------------------------- !! !! subroutine : FACTORIAL_DEMO !! !! sets up the factorial demonstration and governs the !! invocation of 'factorizal' !! subroutine factorial_demo(factorials, count) dll_export factorial_demo integer count integer, dimension(count) :: factorials integer * 4 i,factorial i = 1 do while (i <= count) factorials(i) = factorial(i) i = i + 1 enddo end recursive function factorial(n) result(factresult) integer * 4 n,factresult if (n .eq. 1) then factresult = 1 else factresult = n * factorial(n - 1) endif end