Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / GetFirstFile... gets the last file?!

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 18th Sep 2015 23:38
I have a directory with files Tile_0001.png, Tile_0002.png etc. GetFirstFile() seems to get the last file by name...so I'm guessing it gets the most recent (latest datestamp) file....is that right or am I just confused?!?!

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 19th Sep 2015 01:37
I've just given this a try and I'm seeing what you're seeing: the first file seems to be the most recently created file (not the most recently modified).

Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 19th Sep 2015 11:34
Would be nice to have a flag that enables you to dictate the basis of what is deemed the "first" file. For example 1 for alphabetic, 2 for reverse alphabetic, 3 for earliest time stamp etc. Then to have this aldo affect the GetNextFile command.

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Sep 2015 17:48
The fix is to load all the file names into an array, then sort the array and use it to load the files.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 20th Sep 2015 23:59
Thanks.

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-04-25 13:40:12
Your offset time is: 2024-04-25 13:40:12