|
-
Jan 5th, 2001, 10:50 AM
#1
Thread Starter
New Member
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!
-
Jan 5th, 2001, 03:09 PM
#2
Fanatic Member
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
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Jan 5th, 2001, 07:36 PM
#3
Thread Starter
New Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|