Add an internal variable which returns the number of TC Consoles running either in tabs or standalone.
A TCC instance count may be a better description.
The result is not always accurate, though. This is caused by some weird behaviour of the @LINES function:
(but maybe it is good enough for your purposes):
EDIT: Turns out to be caused by the "| ". It launches a fresh instance of TCC to execute the second part (I need more coffee :-).
The next function works better:
Code:
Function TEST=`%@execstr[ (tasklist /U"%1" tcc |! echo %@INC[%@lines[con:]])]`
Not useful in a standalone TCC sessions or for knowing how many of the TCTABS are running TCC, some may be running other things such as Windows CMD.
I have several alias's that perform different exiting tasks and they need to determine how many TCC instances are running.
An internal variable would be cleaner and presumably faster than the function above.
Bottom line: %_tctabs doesn't meet the need. Thus the suggestion to add an internal variable which returns the number of TC Consoles running either in tabs or standalone. Just saying.
While we're on the subject of addition for future TCC version.
It would also be useful to have internal variables to use in determining global command history, directory history, alias and user function lists status within a TCC session.
Well, what do you know ... it was the timer on & timer off sequence that consumed most of the time ...
Nice work with the backquotes, btw. Makes it look much cleaner!
Shouldn't this be even faster, then?: set __tcccount=`%@execstr[tasklist tcc | echo %@lines[con:]]`
("|!" becomes "|" ; faster according to the helptext. This also eliminates the cause for the extra @inc )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.