>SET DEFAULT TO C:\GRAPHICS >DIMENSION aTIF[1], aFJP[1], aPNG[1], aJPG[1], aIMAGES[1] > >ADIR(aTIF, "*.TIF") >ADIR(aFJP, "*.FJP") >ADIR(aPNG, "*.PNG") >ADIR(aJPG, "*.JPG") > >ACOPY(aTIF, aImages) ??? > >* At this point, how do you add the resulting FILENAMES only from each array, >* if there is data, into the last array, aImages? > >You need a loop for that. ie:
SET DEFAULT TO C:\GRAPHICS DIMENSION aTIF[1], aFJP[1], aPNG[1], aJPG[1], aIMAGES[1] ADIR(aTIF, "*.TIF") ADIR(aFJP, "*.FJP") ADIR(aPNG, "*.PNG") ADIR(aJPG, "*.JPG") myAcolCopy(@aTif, @aImages, 1,1) myAcolCopy(@aFjp, @aImages, 1) myAcolCopy(@aPng, @aImages, 1) myAcolCopy(@aJpg, @aImages, 1) PROCEDURE myAColCopy(taSource, taDestination, tnColumn, tnStart) IF EMPTY(m.tnStart) tnStart = ALEN(taDestination)+1 endif DIMENSION taDestination[m.tnStart-1+ALEN(taSource,1)] LOCAL ix FOR ix=1 TO ALEN(taSource,1) taDestination[m.tnStart-1+m.ix] = taSource[m.ix, m.tnColumn] endfor RETURN ALEN(taSource,1) endprocHowever there is an easier way with using filer.dll that ships with VFP:
LOCAL array aImages[ 1 ] oFiler = CREATEOBJECT('Filer.FileUtil') WITH oFiler .SearchPath = "c:\graphics" .Subfolder = 0 && do not search subfolders .FileExpression = "*.TIF;*.FJP;*.PNG;*.JPG" .SortBy = 3 IF .Find(0) > 0 DIMENSION aImages[ .Files.Count ] FOR ix=1 TO .Files.Count aImages[m.ix] = .Files[m.ix].Name ENDFOR endif endwithCetin