Hi
I can move around diretories fine when running my app through the AppGameKit player but as soon as I convert my T1 program to an iPhone app via XCode and run it seems to be all off path and I can't find the correct way to write the setCurrentDir command.
Here's my folder structure:
media
media/images/
media/images/decks/
media/images/decks/deck01
Originally I scripted it so that the decks folder was on level with images but I've been moving it about to try and find a way to access it and then get back to the media folder.
Here's my code which works when running it via the compiler in Windows. Can someone please let me know where I'm going wrong? I basically want to loop through the files in the decks folder to find some text files with extension .scd, preload the images in the folder and then go back to the media folder so that all of the standard defualt images load.
When I run it on the iPhone as an installed app it doesn't seem to pay any attention to the SetCurrentDir() command
setCurrentDir("images/decks")
for i = 1 to 15
if (i = 1) then fileName$ = getFirstFile()
if (i > 1) then fileName$ = getNextFile()
if (right(fileName$, 4) = ".scd")
inc noOfDecks
deckName = mid(fileName$, 1, len(fileName$) - 4)
endif
next i
loadDeck(deckName + ".scd")
setCurrentDir("")
setCurrentDir("media")
To get this to work via the compiler I've had to setCurrentDir as blank before setting it as media. Setting it as either on its own doesn't work.
On the iPhone it's not going into the images/decks folder and looping through the files.
I would still prefer to have the decks folder on level with the images folder but at the moment I'd settle for whatever works.
the12thplaya