The assumed path and filename (filename base for the modifiers) used for the examples are displayed in the following listing.
C:\Freescale\my demo\TheWholeThing.myExt
Using the %p modifier as the following listing displays the path with a file separator but without the filename.
C:\Freescale\my demo\
Using the %N modifier only displays the filename in 8.3 format but without the file extension, as the following listing displays.
TheWhole
The %n modifier returns the entire filename but with no file extension, as the following listing displays.
TheWholeThing
Using %E as a modifier returns the first three characters in the file extension, as the following listing displays.
myE
If you want the entire file extension, use the %e modifier, as the following listing displays.
myExt
The %f modifier returns the path and the filename without the file extension, as the following listing displays.
C:\Freescale\my demo\TheWholeThing
The path in Listing: Example filename and path used for the following examples contains a space, therefore using %" or %' is recommended, as the following listings displays.
"C:\Freescale\my demo\TheWholeThing"
C:\Freescale\my demo\TheWholeThing'
Using %(envVariable) an environment variable may be used. A file separator following %(envVariable) is ignored if the environment variable is empty or does not exist. If TEXTPATH is set as in following listing, then $(TEXTPATH)\myfile.txt is expressed as in next listing.
TEXTPATH=C:\Freescale\txt
C:\Freescale\txt\myfile.txt
However, if TEXTPATH does not exist or is empty, then $(TEXTPATH)\myfile.txt is expressed as in the following listing.
myfile.txt
It is also possible to display the percent sign by using %%. %e%% allows the expression of a percent sign after the extension as in the following listing.
myExt%