Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capture part of a filepath
Message
 
To
18/07/2002 14:03:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00680095
Message ID:
00680107
Views:
16
>I have a variable (called path) storing a filepath such as X:\AAAA\BBBB\
>I need to capture the BBBB portion of the filepath. However, this filepath isn't always going to be this exact format, but I will always need to get the text between the last two '\'. What is the best way I can do this? Seems like it should be easy, however, I have been struggling with it. Hope this makes sense.
>
>TIA!

If it always ends with backslash you can use
JUSTFNAME(JUSTPATH("X:\AAAA\BBBB\")) && use your path variable here, but just don't call it PATH  :) as it is a reserved word.
if there is no backslash, then
JUSTPATH("X:\AAAA\BBBB")
will work.

Assuming VFP6 or 7, or VFP5 with FOXTOOLS
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform