! DLL3A.F90 Copyright(c) 1994 - 1998, Lahey Computer Systems, Inc. ! Copying for sale requires permission from Lahey Computers Systems. ! Otherwise, distribution of all or part of this file is permitted ! if these four lines are included. ! ! DLL3a.F90, This DLL is for use with the MAIN3 example. ! Please refer to the MK3_50.BAT and MK3_05.BAT files for ! instructions for building this example ! ! This example demonstrates tricky interfaces between ! nested DLLs and MAIN, using a derived type data type MODULE mod TYPE foo_t sequence INTEGER:: i,j(10) REAL::a, b(10) CHARACTER(LEN=10)::ch1,ch2(10) COMPLEX::c1,c2(10) TYPE(foo_t),POINTER:: foo_p END TYPE foo_t END MODULE mod FUNCTION FILL(x) USE mod INTEGER FILL DLL_EXPORT FILL TYPE(foo_t)::x x%i = 100 x%j = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/) x%a = x%i x%b = x%j x%ch1 = "dll strng" x%ch2 = "another string" x%c1 = (1.2,3.4) x%c2 = x%c1 NULLIFY(x%foo_p) FILL = 1 RETURN END FUNCTION FILL FUNCTION FILL2(x) USE mod INTEGER FILL2 DLL_EXPORT FILL2 TYPE(foo_t)::x(10) DO icount = 1, 10 x(icount)%i = 100 x(icount)%j = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/) x(icount)%a = x(icount)%i x(icount)%b = x(icount)%j x(icount)%ch1 = "dll strng" x(icount)%ch2 = "another string" x(icount)%c1 = (1.2,3.4) x(icount)%c2 = x(icount)%c1 NULLIFY(x(icount)%foo_p) ENDDO FILL2 = 1 RETURN END FUNCTION FILL2