The filename-parts syntax is used by PWB to pass the name of the current file to external programs or operating-system commands. You use this syntax in the Printcmd, Readonly, and User switches.
%%
A literal percent sign (%).
%s
The fully qualified path of the current file. If the current file is a pseudofile, %s specifies the name of a temporary disk file created for the external command to operate on. The temporary file is destroyed before returning to PWB and is never accessible to the editor.
%| [[d]][[p]][[f]][[e]]F
Parts of the current filename. The parts of the name are drive, path, filename, and extension. If the current file is a disk file named:
C:\SCRATCH\TEST.TXT
or the pseudofile:
"<COMPILE>Build Results"
the given syntax yields:
Syntax | Disk File | Pseudofile |
%|F | C:\SCRATCH\TEST.TXT | <COMPILE> | |
%|dF | C: , | ||
%|pF | \SCRATCH , | ||
%|fF | TEST | <COMPILE> | |
%|eF | .TXT , | ||
%|pfF | \SCRATCH\TEST | <COMPILE> | |
%s | C:\SCRATCH\TEST.TXT | C:\TMP\PWB00031.R00 | |
%% | % | % |
The title of a pseudofile cannot be specified with the filename-parts syntax, but it is accessible to macros by using the Curfile predefined macro.
Warning:
The %|F syntax always specifies the name of the current file in the active window. For some commands, such as the command specified in the Readonly switch, this may not be the desired file. Use %s for the Readonly switch.
Printcmd, Readonly, User