Results 1 to 3 of 3

Thread: Please Help with managing directories

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    6

    Exclamation

    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!

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    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}

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    6

    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
  •  



Click Here to Expand Forum to Full Width