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 DBPro Corner / MusicJukeBox Program

Author
Message
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 12th Mar 2012 19:32
Hello All!

Well I just finished another exercise project form the book, "Beginner's Guide to Dark Basic," and again need help. The project simulates a jukebox being played. When I run the compiler though, I made a syntax error somewhere. If someone could try and find my error, that would be great.



When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 12th Mar 2012 22:07


should be



VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 13th Mar 2012 17:51
Thank you kamac. That fixed my problem. However, now when I run the program, when I try to run a song, the program stops and I get an error message. The message is in the attached image. I will also up load a compressed file containing the project.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!

Attachments

Login to view attachments
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 13th Mar 2012 17:58
message containing program

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!

Attachments

Login to view attachments
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 19th Apr 2012 20:34
Wondering if anyone has figured out the other problem with my program. Again to restate the problem, While the programing is running, and I go to run one of the songs, the program reports an error and fails to play the song. When I run the program that came with the CD for the Dark Basic Beginner book, the program runs perfectly. If anyone could tell me what the problem is, that would be great.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 19th Apr 2012 22:47
Quote: "Wondering if anyone has figured out the other problem with my program."


Uh, this is just an error window:



It would help if you posted more details such as:
The full error details
What version of DBPro you are running

Try renaming all your paths to absolute paths (the DATA for music and the loade image(s)). If you still get the error, try opening a new file and playing one song at a time (do not dimension any arrays or load any graphics). What happens now?

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 20th Apr 2012 20:45
I'd try this:
IF FILE EXIST(filename$(selector))
PRINT "Now playing "+filename$(selector)
LOAD MUSIC filename$(selector),1
PLAY MUSIC 1
ELSE
PRINT "There was an error loading your selection:"
PRINT selector
PRINT filename$(selector)
PRINT "was not found."
ENDIF

Just modify it so text/print will display with the sync loop correctly


I've found so many oddities with files not loading as you would expect (one command loads them one way the other a different way) that I make it a point to use an error check like this. I think it is really good practice to do so for debugging AND for the end user (you never know when they might accidentally delete a file). This way they know what happened because your program generates a descriptive error.

Unfortunately I don't remember this exercise in the book otherwise I might be able to help pinpoint the issue. As I remember there were a number of incomplete code examples in the book. I do remember getting them all to work with some modification and methods of debugging like I describe above.

I hope this helps!

Login to post a reply

Server time is: 2024-05-17 05:51:21
Your offset time is: 2024-05-17 05:51:21