I use a for loop to iterate through the integers for the next available sprite number and next available image number.
Then I create the sprite, make sure it exists and move on.
If you're looking for an automated way to find the frames, I don't think that is possible.
I make an array that stores the number of frames in each image using the image number as an index (which I use a named constant for).
Also I try very hard to make the image number and the sprite number the same since I really like to use named constants.
For example:
//make some named constants for ease of use
#constant x_frames = 0
#constant y_frames = 1
#constant ogre_sprite = 10
dim image_data(11,2) //I would store all the images' data here
//now set the frames
image_data(ogre_sprite,x)=13
image_data(ogre_sprite,y)=8
ogre_image = "ogreattack.bmp"
CREATE ANIMATED SPRITE ogre_sprite, ogre_image, image_data(ogre_sprite,x),image_data(ogre_sprite,y), ogre_sprite
The other, more likely cleaner method would be to use UDTs to store x_frames, y_frames, ogre_sprite, and ogre_image.
Something like this:
type EnemyType
x_frames as int
y_frames as int
sprite_num as int //also the same as image_num if you desire
ogre_image as string
endtype
Ogre as EnemyType
The you may go as far as to use the READ BYTE/FILE/FLOAT/etc commands to load the data in systematically from a
data file.
Hope all of this helps, I kind of got carried away trying to think out how I'm doing it in my current project.