Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do I determine the name of the current _folder_?

Author
Message
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 30th May 2005 13:08
I need to figure out what folder the user is currently in for my file browsing system, but I don't want the entire file path, because this program will be used in multiple locations so the entire path will always change, but the folder name wont. I can't find a command that will return the current folder, do I need to make a custom one myself?

NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 30th May 2005 14:19 Edited at: 30th May 2005 14:47
QuothTheRaven,

You might need to get the whole path, then take the path string and use a bit of string manipulation to get just the folder name. Take the string and use the right$() command in a loop, until you come to the first [i][/i](backslash) symbol. Then, grab the string, leaving the backslash behind, and then you're left with just the folder name. I believe this is what you are needing. Below is an example code snippet, using a fake directory path string to use string manipulation on.




+NanoBrain+
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 30th May 2005 15:11
I coded a different function, specifically because it had to be pretty strict, meaning that I was looking for folders inside a folder called \Models\ and I needed to return only any subfolders in there. I used a substring function from the codebase to help me out.


Login to post a reply

Server time is: 2024-09-23 21:24:36
Your offset time is: 2024-09-23 21:24:36