Saving images to an array

Let’s say I have an array setup like this:

Dim TestArray(100) as Auto

Let’s say I dropped in 100 images into my Xojo app, named Image001, Image002, Image003, etc.

What is the easiest way to populate all 100 slots of the TestArray() with each image, without having to manually declare each one, e.g.:

TestArray(1)=Image001 TestArray(2)=Image002 ...

Or, must it be done manually like that?

You could load the images from a folder instead.

Thanks Paul …

I see GetFolderItem, etc. but it doesn’t apply to iOS, does it? Is there an alternative for iOS?

Thank you.

I also saw the following in the Xojo Documentation:

[quote]On iOS, to get a reference to a FolderItem, use SpecialFolder. For example:

Dim file As FolderItem = SpecialFolder.Documents("MyFile.txt")

… but I’m not sure how to reference “Image001” in my “Testimages” folder in my iOS app. Could you possibly give me a code example for my array? Thank you!

You’ll have to get your images to the device. For this you’ll use a Copy Files Build Step, copying them to a folder in the Resources folder. An example is on this doc page: