PDA

Click to See Complete Forum and Search --> : Please Help with managing directories


Shoke
Jan 5th, 2001, 09:50 AM
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!

YoungBuck
Jan 5th, 2001, 02:09 PM
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....



' 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

Shoke
Jan 5th, 2001, 06:36 PM
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?