1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why doesn't this @Field function work?

Discussion in 'Support' started by mathewsdw, Dec 24, 2012.

  1. mathewsdw

    May 24, 2010
    Likes Received:
    The best way to start is probably to show a complete TCC session:
    [Z:\Level 1\Level 2\Level 3\Level 4\Level 5\Level 6]fdir
    12/24/2012  10:57              0  ABC.SEXT
    12/24/2012  10:57              0  DEF.LEXTENSION
    12/24/2012  11:00              0  GHI.BEXTEN
    [Z:\Level 1\Level 2\Level 3\Level 4\Level 5\Level 6]echo %Sep
    [Z:\Level 1\Level 2\Level 3\Level 4\Level 5\Level 6]PDir "::(SEXT|LEXTENSION)" /S
    /A-D /(~@Field[%Sep,-2,*]~ @FileName[*])
    ~~ ABC.SEXT
    [Z:\Level 1\Level 2\Level 3\Level 4\Level 5\Level 6]
    The first line shows the current directory, the second through fourth lines what's in the current directory. The sixth line shows the contents of a variable named "Sep". The seventh line is a PDir command with an @Field function enclosed in tildes with the field separator being "%Sep" (a backslash, of course), the second field of the full path up (should be "Level 5" me thinks) and the current full file name being indicated by the "*", of course.

    As you can see above, what comes out between the tildes is nothing, a null string.

    Where am I going wrong in this apparently simple task?

    An update:

    In experimenting while typing this posting, I changed the @Field function to "@Field[%Sep,-2,%%@Full[*]]", and this worked. The question is, of course, why I need the "@Full" function given that the asterisk is, as I understand it, already the full path to the file (and some simple experiments confirm that). Since at this point I have the problem solved with a mysterious (to me!) workaround, the answer to this question is just for my edification/education.

Share This Page