
-----------------------------------
Leftover
Thu Jan 13, 2005 7:08 pm

Loop Exit Help...
-----------------------------------
Well, here I am again :). Working on my final, trying to learn and stay away from here but it's impossible :D

What I know how to do: Exit a loop by pressing a key and hitting enter, Ex.
loop
Music.PlayFile (%systemroot/whatever/intro.wav)
exit when word = "victory is mine"
end loop

which will essentially end the loop when I type in victory is mine... Only problem, it's not exactily what I want it to do, and for me (I'm using it for playing intro theme song for my final) it doesn't stop the music, it waits for it to finish then stops.

What I want to do: Be able to exit the loop and stop the song wherever it is once a menu object is selected with the keyboard and "Enter" is pressed to advance on to the next menu, Ex.
loop
Music.PlayFile (%systemroot/whatever/intro.wav
kill music and exit when keydown = "Enter"
end loop

(( Or something like that, I don't know the keydown commands much yet but I'm sure I'll be learning soon ))

If I am attacking this wrong (by using loops or whatever) feel free to shoot me down. Any help is aprecieated and will be put too good use :) Thanks in advanced, L.O.

-----------------------------------
Jonny Tight Lips
Thu Jan 13, 2005 7:51 pm


-----------------------------------
You need Music.PlayFileStop and/or Music.SoundOff. Look them up in the turing help file then if you need more help come back.

-----------------------------------
Leftover
Thu Jan 13, 2005 8:24 pm


-----------------------------------
Okay I got that far :). Using Music.PlayFileLoop instead of the loop then Music.PlayFile, and I know how to kill it with Music.SoundOff, but not sure how to make it do that command when enter, or ascii 10 is pressed.

-----------------------------------
Leftover
Thu Jan 13, 2005 9:11 pm


-----------------------------------
Okay I got it from there, thanks Jonny.

I used:


Music.PlayFile (%systemroot/blah/whatever.wav)

...

loop
    if hasch then
        move := getchar
        if move = chr (10) then
            Music.PlayFileStop
        end if
    end if
end loop

