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.

AppGameKit Classic Chat / Issue 492: Problem with File/Folder commands

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Feb 2013 13:37 Edited at: 16th Feb 2013 13:39
Running the following function in my code results in a crash when reading a file next.

What is the expected output?
I expect the Music_Playlist$ array to contain filenames. (which it does)

What do you see instead?
After the function call, the next time I read a file, the program crashes.

What version of the product are you using?
1.08 beta 8

On what operating system?
Shameful Windows 8

Please provide any additional information below.
I believe the issue is related to the setfolder commands. If I change the top of the test function to be:

The program will crash as above, which tells me it's not the GetFirst/GetNext commands.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 14:45
Quote: "After the function call, the next time I read a file, the program crashes."


example? did you want read from the media folder ?
SetFolder("media") not "" ?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Feb 2013 16:23
Since the media folder is the default, is this required? The first call sets the read folder to be music, which implies it's already in the media folder.

Besides, as per the help files, if I call setfolder( "music/" ) then setfolder( "media" ) This will attempt to set the folder to "media/music/media" The help files state to return to the default folder to call setfolder( "" )


As for an example, just run this function, then attempt to open a file with the opentoread command.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 17:11 Edited at: 16th Feb 2013 17:12
hmm, i don't know what help is the last one.

setfolder("") is the root, not your default media

did you try getfileexists before read?

i think the online help is newer
http://www.appgamekit.com/documentation/Reference/File/SetFolder.htm
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Feb 2013 20:44
Quote: "setfolder("") is the root, not your default media"

Eureka!

I simply setfolder("") : setfolder("media") and all's well in the world! That's fixed it!
Thanks for being the voice of reason!

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 21:09
ok
i try a little bit.
looks like you can set it direct with a beginning /

SetFolder( "/music/" ) = root/music
SetFolder( "/media/" ) = root/media
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th Feb 2013 23:33
I believe I tried that too with no luck. But either way, it's all working now. My "proper" music player is now fully working, giving me almost total control over what music is playing. (Well, I can skip between tracks at will and have the ability to display the track details when switching to a new track. video to follow if anyone wants to see it. )

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Feb 2013 01:46
Here's that video if anyone's interested.


I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]

Login to post a reply

Server time is: 2024-11-24 07:27:23
Your offset time is: 2024-11-24 07:27:23