02-17-2005, 12:29 AM
as copied from fmodtest
ok in my program i have this i know its not right but how do i fix this
if lev=1 then Const MusicFile = "l1.mid"
if lev=2 then const musicfile="l2.mid"
i get the error message duplicated definition musicfile
i know that it being a const its saying that there can only be one definition even though its within the if statement so how do i get it to accept both when lev=1 i want it to play l1.mid and when lev=2 play l2.mid??
Code:
Const MusicFile = "dne_trtn.mod"
Dim Shared Handle As Long
If FSOUND_GetVersion <= FMOD_VERSION Then
ErrorQuit "FMOD version " + STR$(FMOD_VERSION) + " or greater required"
End If
If FSOUND_Init(44100, 32, 0) = FALSE Then
ErrorQuit "Can't initialize FMOD"
End If
Handle = FMUSIC_LoadSong(MusicFile)
If Handle = FALSE Then
ErrorQuit "Can't load music file " + CHR$(34) + MusicFile + CHR$(34)
End if
FMUSIC_PlaySong(Handle)
Print "FMOD test for freeBASIC"
Print
Print "(press any key to quit)"
Sleep
FMUSIC_FreeSong(Handle)
FSOUND_Close
End
ok in my program i have this i know its not right but how do i fix this
if lev=1 then Const MusicFile = "l1.mid"
if lev=2 then const musicfile="l2.mid"
i get the error message duplicated definition musicfile
i know that it being a const its saying that there can only be one definition even though its within the if statement so how do i get it to accept both when lev=1 i want it to play l1.mid and when lev=2 play l2.mid??
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be