By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!v:\> type g:\tc19\tcexit.btm
ECHO %_CMDLINE
PAUSE
echo foo & exit
BEEP 440 2
ECHO %_CMDLINE
PAUSE
echo foo & exit
echo %_cmdline
pause
If aliases are the only place it can be used reliable (and I'm not sure of that) it should be made clear in the halp file.This is pointless (we've had this conversation before) -- %_cmdline shows the content of the current command line, and you don't have a command line when you're in TCEXIT. %_cmdline is for use by key aliases that want to modify the contents of the command line.
g:\tc19> type tcexit.btm
echo %_cmdline
pause
g:\tc19> tcexit.btm
tce
Press any key when ready...
Then, with this TCEXIT
Code:echo %_cmdline pause
1. Why does is @exit command, when given on the command line, ALWAYS echoed by TCEXIT, while a simple "exit" is never echoed?
2. Why does "echo foo & exit", (typed, not history-recalled), cause the PAUSE not to be executed? The history-recalled version does it too if any changes were made to the recalled line ... adding a trailing space, for example, or simply moving the cursor in the recalled line without making a change.
If aliases are the only place it can be used reliable (and I'm not sure of that) it should be made clear in the halp file.
I don't think a parenthetical remark with "most useful in key aliases" makes it clear that that's about the only place it's useful.I think the help does make it clear that it's intended to be used by key aliases. What did you think it would return in a batch file (where you don't have a command line)?
And I never would have dreamed that batch files don't have a command line!_CMDLINE returns the current command line. (This is most useful in key aliases.)
In another thread, someone asked if TCEXIT could tell why TCC was exiting. I immediately thought of _CMDLINE naively thinking batch files had command lines. That led me to an investigation that I'll gladly abandon.Vincent, I'm not sure what you're trying to do. But it seems to me that if you want to hook EXIT, the smart way to do it would be through a plugin EXIT command. You can examine the command line, do anything you want with it -- or to it -- and then return the magic value 0xFEDCBA98 to let TCC do all its cleanup and exit. Or return anything else to prevent TCC from exiting.
In another thread, someone asked if TCEXIT could tell why TCC was exiting. I immediately thought of _CMDLINE naively thinking batch files had command lines. That led me to an investigation that I'll gladly abandon.
In another thread, someone asked if TCEXIT could tell why TCC was exiting. I immediately thought of _CMDLINE naively thinking batch files had command lines. That led me to an investigation that I'll gladly abandon.
Speaking of CMDLINE2, what can you do with it? Any mention of it in a BTM file throws TCC into some sort of infinite loop which you can't Ctrl-C out of.What you want is %_EXIT, and perhaps %CMDLINE or %CMDLINE2. Definitely not %_cmdline!
v:\> type cl2.btm
if "%CMDLINE2" == "foo" echo foo
v:\> cl2.btm
(it goes forever)
Speaking of CMDLINE2, what can you do with it? Any mention of it in a BTM file throws TCC into some sort of infinite loop which you can't Ctrl-C out of.
Can you use it at all without turning off nested variable expansion? Have you got an example?