- Aug
- 2,799
- 144
Inspired by: Option to specify XDIR editor
Until such an option exists in XDIR,
here's a library function similar to XDIR,
that will open files with your choice of editor,
if the editor is installed on your system.
From the TCC command line;
Using the xdir library function,
I can press Ctrl-W to VIEW the file
I can press Ctrl-L to LIST the file
I can press ENTER to edit the file in my editor of choice.
xdir could also be .btm file instead of a library function.
Use commands /d xdir to disable the internal xdir command.
You could also call it MyXDir if you so desire.
Use this code as a starting point for your own XDIR command.
Ref: SELECT - Interactively select files for a command
Ref: XDIR
Ref: UltraEdit | Secure Text Editor Built for Huge Files
Joe
Until such an option exists in XDIR,
here's a library function similar to XDIR,
that will open files with your choice of editor,
if the editor is installed on your system.
Code:
xDir {
@SETLOCAL
@ECHO OFF
echo TCEdit.exe^nuedit64.exe > tmp9:
if defined theEditor unset theEditor
set theEditor=%@select[tmp9:,1,1,25,40,Which Editor?]
iff defined theEditor then
iff %# gt 0 then
select /z %theEditor (%1)
else
select /z %theEditor (*.*)
endiff
endiff
ENDLOCAL
}
Code:
U:\>which xdir
xdir is a library function
From the TCC command line;
Code:
xdir *.btm
Using the xdir library function,
I can press Ctrl-W to VIEW the file
I can press Ctrl-L to LIST the file
I can press ENTER to edit the file in my editor of choice.
xdir could also be .btm file instead of a library function.
Use commands /d xdir to disable the internal xdir command.
You could also call it MyXDir if you so desire.
Use this code as a starting point for your own XDIR command.
Ref: SELECT - Interactively select files for a command
Ref: XDIR
Ref: UltraEdit | Secure Text Editor Built for Huge Files
Joe