Refer to Parent Directory

For questions about using Classic.

Post » Thu Oct 22, 2009 3:25 pm

Good morning,

I searched a bit and didn't see an answer to this, so I'm wondering if it's possible. I'm planning for my project to have an "episodic" structure, where there is a main executable folder, and separate episodes that are self-contained in their own subdirectories. I'm wondering if there is a way to refer to a PARENT directory above the current AppPath. For instance, I have a BGM folder for music files that includes music which would be common to several episodes, so I would like to have my XAudio2 object refer back up a level to the "main" BGM folder instead of having repetitive files in each episode's own subdirectories. Since they're OGG files, I'm keeping them external and playing them through channels rather than importing them. I tried using "..\" as a blind guess, and it didn't seem to work. So is it a possibility?
B
1
G
3
Posts: 6
Reputation: 837

Post » Thu Oct 22, 2009 3:50 pm

Using "../" will take you back a folder. I just tested it, so it should work.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Oct 22, 2009 5:08 pm

Forward slash. I am a moron. Thank you!

(Edit) Also it would help if I were backing out far enough in the first place.
B
1
G
3
Posts: 6
Reputation: 837

Post » Thu Oct 22, 2009 7:29 pm

You're meant to use backslashes for local directories, but I think Windows replaces / with \ just in case you got it wrong.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Oct 22, 2009 11:50 pm

Yes, they're interchangeable it seems, I was just forgetting a level so I actually needed "..\..\" instead. At least I was on the right track!
B
1
G
3
Posts: 6
Reputation: 837


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests