! MAIN3.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. ! ! MAIN3.F90, This is a main program unit for use with the ! DLL3a and DLL3b DLLs. Please refer to the MK2_50.BAT ! and MK2_05.BAT files for instruction on building this example ! ! This example demonstrates tricky interfaces between ! nested DLL 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 PROGRAM main USE mod TYPE(foo_t)::f1, f2(10), f3 POINTER f3 LOGICAL l,COMPARE, COMPARE2 INTEGER FILL, FILL2 DLL_IMPORT FILL, COMPARE, COMPARE2, FILL2 OPEN(10, "temp") WRITE(10,*)"should print 3 1s and 3 TRUEs" i = FILL(f1) WRITE(10,*)i i = FILL2(f2) WRITE(10,*)i ALLOCATE(f3) i = FILL(f3) WRITE(10,*)i l = COMPARE(f1) WRITE(10,*)l l = COMPARE2(f2) WRITE(10,*)l l = COMPARE(f3) WRITE(10,*)l STOP "Passed" ! when we get this far, everything works END