Welcome!
Log In
Create A New Profile
Home
>
WinDev Forum
> Topic
Advanced
[WD] Directory ?
Posted by
infos
Forum List
Message List
New Topic
infos
[WD] Directory ?
March 06, 2020 10:36AM
Registered: 5 years ago
Posts: 236
Hi all
sDirectory is string
sDirectory = fSelectDir("", "")
example
sDirectory = "H:\WINDEV 23\Programs\Rules"
How to extract only the "Rules" folder?
EDT_Directory = "Rules"
[
infosonline.net
]
Edited 1 time(s). Last edit at 03/06/2020 10:37AM by infos.
Reply
Quote
gpredl
Re: [WD] Directory ?
March 06, 2020 10:57AM
Admin
Registered: 5 years ago
Posts: 501
Hi, that's easy. Find out whether the last character is a "\" and delete it. Next, find the number of "\" characters in the string. Then use extractstring(..) to extract the last string between "\"s.
Kind regards,
Guenter Predl
office@windev.at
Reply
Quote
Bruno
Re: [WD] Directory ?
March 06, 2020 11:07AM
Hi.
No validations done, but you can use something like:
ExtractString(fExtractPath(CompleteDir(sDirectory),fDirectory),2,"\",FromEnd)
Regards,
Bruno
Reply
Quote
infos
Re: [WD] Directory ?
March 06, 2020 04:11PM
Registered: 5 years ago
Posts: 236
Yes, that's it
ExtractString(fExtractPath(CompleteDir(sDirectory),fDirectory),2,"\",FromEnd)
Thanks Bruno, Thanks Predl
[
infosonline.net
]
Reply
Quote
Newer Topic
Older Topic
Print View
RSS
Author:
Your Email:
Subject:
Help information
BBcode help
Smileys help
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
[Please, enable JavaScript to see the code]
Enter code:
Message:
[Please Enable JavaScript]