Another simple question re. Take Command/TCC window witdth in characters...

May 24, 2010
855
0
Northlake, Il
Really simple. I'd like to know the current width of the current TCC window in characters (similar to what %_Rows certainly seems to be - I get consistent numbers as I increase/decrease the TCC window height), but I really haven't been able to figure exactly what %_Columns is; when the window is "full width", it returns "83", but no matter how "narrow" I make the TCC window after that it returns "80".
 
May 24, 2010
855
0
Northlake, Il
Thank you, Rex, that certainly does explain it. But I guess that means that my ultimate goal here (which was to have error messages wrap to the next line on a blank whenever possible rather than in the middle of a word) is unachievable, right?
 
May 20, 2008
11,401
99
Syracuse, NY, USA
If you're trying to shrink your window below 80 columns (and you get a horizontal scrollbar), then no, you can't do that. There isn't any way to determine the physical size of a window < 80 columns.
If you're trying to shrink your window below 80 columns (and you get a horizontal scrollbar), then no, you can't do that. There isn't any way to determine the physical size of a window < 80 columns.
My 4CONSOLE plugin offers _WINROWS and _WINCOLS which will give the window dimensions, in characters.
Rex, that's so easy to do ... why not put it in a future version of TCC?
 
May 24, 2010
855
0
Northlake, Il
Vince,

I'm somewhat confused at this point. #1. I do have "4Console" installed (which I though I did and the "?" command verifies), #2 If I search for "_WinCols" in Rex's standard help file, nothing comes up ("No topics found", and that's also true for just "WinCols"; and I just search for "columns" the only even slightly relevant thing that comes up is "_Column", which has absolutely nothing to do with what I'm looking for), #3. I do not find any help (.chm file) for "4Console" so I obviously can't look there, and if I enter "help _wincols" I get "console window columns" (I don't even know where that "help" "comes" from), and finally #4. If I type "Echo %_WinCols", I never get a number less than 80, as Rex would suggest.

- Dan
 
May 20, 2008
11,401
99
Syracuse, NY, USA
Vince,

I'm somewhat confused at this point. #1. I do have "4Console" installed (which I though I did and the "?" command verifies), #2 If I search for "_WinCols" in Rex's standard help file, nothing comes up ("No topics found", and that's also true for just "WinCols"; and I just search for "columns" the only even slightly relevant thing that comes up is "_Column", which has absolutely nothing to do with what I'm looking for), #3. I do not find any help (.chm file) for "4Console" so I obviously can't look there, and if I enter "help _wincols" I get "console window columns" (I don't even know where that "help" "comes" from), and finally #4. If I type "Echo %_WinCols", I never get a number less than 80, as Rex would suggest.

"?" will only show you a plugin's **commands**. "PLUGIN /V" will show the variables for all plugins. 4CONSOLE comes with a text file showing everything. When you "HELP _WINCOLS" TCC passes it on to plugins; 4CONSOLE recognizes it and responds.

I have no idea why you can't see widths less than 80. I just opened a normal console (80x25) and resized it. I got

Code:
v:\> echo %_wincols %_WINROWS
51 23
Nazjk1wAAAABJRU5ErkJggg==
 
May 20, 2008
11,401
99
Syracuse, NY, USA
"?" will only show you a plugin's **commands**. "PLUGIN /V" will show the variables for all plugins. 4CONSOLE comes with a text file showing everything. When you "HELP _WINCOLS" TCC passes it on to plugins; 4CONSOLE recognizes it and responds.

I have no idea why you can't see widths less than 80. I just opened a normal console (80x25) and resized it. I got

Code:
v:\> echo %_wincols %_WINROWS
51 23
Nazjk1wAAAABJRU5ErkJggg==

I pasted an image into my last post. It looked fine in the composition window, but not in the thread view after it was posted. What's up? Anyway I have attache
wincols.png
d it to this post.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
"?" will only show you a plugin's **commands**. "PLUGIN /V" will show the variables for all plugins.

I personally like PLUGIN /I. That option lists commands, variables, functions, keystrokes, and some additional plugin-specific info including the filename, version, and a brief description.
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
My 4CONSOLE plugin offers _WINROWS and _WINCOLS which will give the window dimensions, in characters.
Rex, that's so easy to do ... why not put it in a future version of TCC?

Because I think that reducing a console window to < 80 characters is probably the single most useless thing you can do in Windows. I'm mystified by the (thankfully tiny) minority of users who think it's a good idea to have to constantly manually scroll their window back and forth to see their I/O.
 
May 20, 2008
11,401
99
Syracuse, NY, USA
Because I think that reducing a console window to < 80 characters is probably the single most useless thing you can do in Windows. I'm mystified by the (thankfully tiny) minority of users who think it's a good idea to have to constantly manually scroll their window back and forth to see their I/O.

I do it with some regularity. If I have a batch file monitoring some process and only producing a few characters of output each line, I'll size it down to nearly nothing. But I must admit that when I do that, I have no reason whatsoever to ask how big the console window is.
 
May 20, 2008
11,401
99
Syracuse, NY, USA
It'd be easier just to put that batch file in a Take Command tab window; then it doesn't take any room at all!
A 30 x 1 character console window can be tucked into a convenient place where I can see it while doing other things ... that's definitely not a job for TCMD.
 
May 24, 2010
855
0
Northlake, Il
Guys,

Several comments about the above: %_WinCols yields no number for me, ever, less than 80 (somewhat ironically given what Vince says vs. what Rex "suggests" in the above), and, not only that, "Echo %_WinCols" yields a "null" string (i.e., "Echo is OFF") in a stand-alone TCC session, which is certainly not any better if not actually worse. (And Rex, I want to do this because I, like Vince if nobody else so far in this thread, often have very long running batch files (as in many hours) that I run in stand-alone TCC and/or Take Command windows that I keep in the "corner" of screen to kind of "monitor" in the background and that sometimes produce error (or "warning") messages that I want to know the full "details" about just by glancing at the window in the corner of the screen. Put simply, I am quite disappointed if that is not possible because that is, exactly, what I really want to do. (I've been considering putting a "message box" up when that happens, but I haven't yet decided whether to do that because I like the way things are (should be) now: When the batch file has a "problem" it displays the message and then "pauses" until I hit a key of some kind - particularly the "[Esc]" key meaning I want to abort the whole thing, and I'd really rather not have that message box "interrupt" what I am doing at any present moment - I get distracted and lose track of what I am doing very easily.)

So, the only question remaining here is "why doesn't 4Console do what Vince thinks is should do?"

- Dan
 
May 20, 2008
3,515
4
Elkridge, MD, USA
Because I think that reducing a console window to < 80 characters is probably the single most useless thing you can do in Windows. I'm mystified by the (thankfully tiny) minority of users who think it's a good idea to have to constantly manually scroll their window back and forth to see their I/O.

One reason is poor eyesight - you use low screen resolution, thus blowing up all windows to easy readability. This can reduce the displayable area of a window below 80 columns easily.
 
May 20, 2008
11,401
99
Syracuse, NY, USA
%_WinCols yields no number for me, ever, less than 80 (somewhat ironically given what Vince says vs. what Rex "suggests" in the above), and, not only that, "Echo %_WinCols" yields a "null" string (i.e., "Echo is OFF") in a stand-alone TCC session

_WINCOLS will be useless in a TCMD tab because TCMD keeps resizing the (hidden) console (and _WINCOLS knows nothing about TCMD; it deals strictly with the console).

If in a stand-alone TCC, _WINCOLS is an empty string, that suggests that 4CONSOLE is not being loaded by your stand-alone TCCs. Without 4CONSOLE loaded, TCC will think there is no variable named _WINCOLS and you'll get an empty string. In a stand-alone TCC, make sure 4CONSOLE is loaded (plugin /i 4console).

The only way I can imagine _WINCOLS failing is if there's **NO** console (a detached TCC) and it's clear you're not doing that. And even then, _WINCOLS would produce a non-empty string (with something meaningless in it). It is utterly simple and it cannot return an empty string:

Code:
INT WINAPI _WINCOLS (WCHAR *psz)
{
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    CSBInfo(&csbi); // GetConsoleScreenBufferInfo on "CONOUT$"
    Sprintf(psz, L"%u", csbi.srWindow.Right - csbi.srWindow.Left + 1);
    return 0;
}
 
May 24, 2010
855
0
Northlake, Il
Vince,

You are, of course correct, and that totally explains, of course, how both you and Rex can be correct. But that does leave one little (thankfully, now unimportant) question: Before I made my posting that under TCC %_WinCols was returning nothing (i.e., a "null" string) I even went so far as to use the TCMD "Save to file..." menu option to save the session to a file (of course) and I then loaded said file into Notepad and found "Echo %_WinCols", which I then copied from the Notepad "document" into a new TCC session to do everything I could do to ensure that I wasn't making a typing error of some kind due to my general clumsiness and vision issue(s), and I got the results that I indicated. However, I just opened up a "new" TCC session to try various version(s) of the "Plugin" command and all of those version(s) indicated that the all of the plugin(s) were, in fact, being loaded. Being surprised by this, I entered "Echo %_WinCols" and it came back with "80", I narrowed the window and did it again and this time it came back with "24", success!!!! Why the that didn't work in my "original" TCC windows is beyond me at this time; but I don't think it really matters!!! Again, thank you very much! (And Rex, you should remember the "differences" between TCC sessions run in Take Command windows and those that are run standalone! :) )

- Dan
 
Similar threads
Thread starter Title Forum Replies Date
jdanielp Cannot step into and/or call another .bat file when debugging .bat file Support 2
vefatica Another popup problem Support 10
S How to? Runs start /w in invisible mode OR run program after exit of another one Support 3
G Press on another Window Support 24
M Another possibly strange remote registry issue Support 5
vefatica Another problem with build 22. Support 3
Patulus Yet another thread on CMD compatibility Support 16
M Take Command 18, migrating to another machine, license problem. Support 1
MickeyF Another TPIPE question Support 6
vefatica Another installer thingy Support 1
vefatica Another @EVERYTHING question Support 4
C Touch command — I Need to touch matching files in another directory. Support 5
M Another "What is wrong?" Support 8
Bill de Haan Another installation is in progress Support 6
fishman@panix.com Another Problem with The Installer Support 1
Charles Dye Another modest proposal Support 4
Dan Glynhampton Documentation v15 help: Another mailto: link oddity Support 0
M WAD Another weird copy command errror... Support 2
M Yet another strange something re something called "@TCONVERT" Support 8
Charles Dye Documentation Another help nit Support 3
K_Meinhard Documentation Another installer nit Support 1
ehab aboudaya How to? change ALT-F6 to another key Support 1
A How to? Pass output from ffind to another command in a BTM file Support 5
Q TCC: (Sys) The process cannot access the file because it is being used by another process. Support 0
M Another bit of weirdness.... Support 0
S MOVE from FTP directory to another FTP directory - bug?? Support 2
vefatica Another debugger observation Support 12
vefatica Another DO /L question Support 1
M Another TCMD "crash" situation... Support 2
S Need help to execute TCC commands on another system Support 6
B TCC doesn't run using another user Support 2
H Another multiple FTP password prompt issue Support 2
Peter Bratton Another little bug? Support 1
M Another problem with renaming files... Support 3
nikbackm Another HISTORY dialog issue Support 0
vefatica Another help nit Support 12
S Another 4NT 8.02 vs TCC 9.02 diff - MOVE command Support 3
p.f.moore Running another batch file without CALL Support 7
samintz How to? TPIPE /simple=61 Support 6
GermanDirk How to? EVENTLOG Command with simple User Rights not functional Support 4
H TPIPE /simple=4 Support 12
T How can I send a simple parameter to a script, in tc 25? Support 2
C No simple way to tell new Alerts Support 8
P Simple RegEx copy Support 9
C WAD tpipe /simple=28 Support 8
C tpipe /simple=28 error Support 5
P WAD TC 15.0.1.58 x64 crasches with a simple dir command Support 18
M Maybe Maybe I'm being stupid (again), but a simple question... Support 4
M What am I doing wrong in this (very simple!) code? Support 3
M How to? A very simple question re. the current line number in a batch file... Support 2

Similar threads