-
Hi,
I have a bunch of sounds in my game which are needed throughout the game. I have therefore made the locations of the sounds as constants. However, the locations on my computer is going to be different from another computer, and since i have the sounds as constants, i can't use
app.path!
What can i do?
Please Help!
-
In order to get this to work right and use the constants you will still have to use the App.Path property, you could probably do something like this....
Code:
' assume the file in is in a folder named Folder in the application path
Private Const SOUND1 = "Folder\Sound.wav"
Private Sub MakeNoise()
Dim sSoundPath
sSoundPath = IIf(Right(App.Path, 1) = "\", App.Path & Sound1, App.Path & "\" & SOUND1)
'code to play sound
End Sub
-
Ok
Hi, im a beginner at vb, i just wanted to know what the iif does? do i have to type :
sSoundPath = IIf(Right(App.Path, 1) = "\", App.Path & Sound1, App.Path & "\" & SOUND1)
whenever i play a sound?