i want to put music into my program, so i did this:
Quote:
finished := false
process bgmusic (welcome_music : string)
    loop
        Music.PlayFile (welcome_music)
        exit when finished
    end loop
end bgmusic
procedure welcome_screen
     fork bgmusic ("bgmusic1.wav")
     (all my other codes)
end welcome_screen
welcome_screen
then i want to play another music on another screen, so i did this:
finished := false
Quote:
process bgmusic (welcome_music : string)
    loop
        Music.PlayFile (welcome_music)
        exit when finished
    end loop
end bgmusic
procedure welcome_screen
     fork bgmusic ("bgmusic1.wav")
     (all my other codes)
end welcome_screen
procedure menu
     finished:=false
     fork bgmusic ("menusong.wav")
     (other codes)
end menu
welcome_screen
finished:=true
menu
when i ran the program, the menu procedure played both songs. How can i prevent this without making another process? 