>Howdy experts,
>
>I am looking to calculate the number of files. I have a folder called bkngimgs. I want to allow my setup program to Capture the number of images that are in that irectory and then use that number to get a random number and select that file for the background image for my intial splash screen.
>
>Any ideas how to accomplish this? Is this a good approach or should I look at capturing all file names into a table and generating the random record against the table?
A concise way to do it:
#DEFINE IMAGES_REPOSITORY "C:\Users\" + ALLTRIM(SUBSTR(SYS(0), AT("#", SYS(0)) + 1)) + "\Pictures\*.jpg"
LOCAL ARRAY Images(1)
? m.Images(EVL(ROUND(RAND() * ADIR(m.Images, IMAGES_REPOSITORY), 0), 1), 1)
----------------------------------
António Tavares Lopes