ZTree.com  | ZEN  | About...  

 Index   Back

[ZEP] A new % value   [ZEP]

By: John Gruener     Orlando, Florida  
Date: Jul 04,2019 at 17:31
In Response to: [ZEP] A new % value (Walt)

> Given
> -- directory structure C:\AAA\BBB\CCC\DDD\EEE
> -- "branch root" is CCC
> -- current file is ...\EEE\FILE.EXT
> then
> -- %c returns DDD\EEE\
> -- %n\%c returns CCC\DDD\EEE
> -- %r\%c\%4.%5 returns C:\AAA\BBB\CCC\DDD\EEE\FILE.EXT

Two corrections Walt:

As in your original post, %c should not return a trailing backslash.

Also, your use of %n is not correct. As I mentioned in the above post here:
https://ztw3.com/forum/forum_entry.php?id=122370
All batch parameters treat "current" as the directory in which the highlighted file resides. This includes %6, %n, %e and %p.

So in your example, %n\%c would return:
-- EEE\DDD\EEE
which of course would be an invalid path.

Note also that %n and %e are simply the name and extension portions of the %6 parameter. So unless for some reason you want only the name portion of the file's current directory it's better to use %6, just in case the directory name has a period in it.

- John

77 views      
 

Messages in this Thread

 
94,426 Postings in 11,918 Threads, 348 registered users, 10 users online (0 registered, 10 guests)
Index | Admin contact |   Forum Time: Sep 20, 2019 - 1:59 am EDT  |  Hits:28,651,807  (249 Today )
RSS Feed