! This file: ! http://ftp.aset.psu.edu/pub/ger/fortran/hdk/PackExample.f90 ! Program PackExample ! H. D. Knoble, November, 2004. ! ! Works with F-Compiler Integer, Dimension(5) :: X = (/1,2,3,4,5/) Integer, Dimension(3) :: Y Logical, Dimension(5) :: L L=.true. L((/2,4/)) = .false. Y=Pack(X,L) print*, "Y=",Y ! Result is: 1 3 5 End Program PackExample