: Say for instance I would want the program to randomly load 1 of 5 pictures. How would I have to change the code? Ive been boggling over this one and simply cant come up with an answer because I dont know how to make the Integer based randomize command agree with something like a file in a directory.
:
Here is a simple example:
i := Round(Random*6+1); { Create a random number from 1 to 5 }
Filename := Format('%.3d.bmp', [i]); { Create a filename with 3 digits }
These two lines will give you filenames like "001.bmp", "002.bmp", etc.