How to? Understanding @select[]

Dec 7, 2009
Left Coast, USA
I used @select[] successfully for a long time in 4NT but am finding its behavior somewhat baffling in TCC.

I have a two-line text file "test.tmp". Both lines contain filenames that aren't especially long.

This command:

echo %@select[test.tmp,0,49,300,200,Pick a filename]

produces a SELECT window about an inch and a half wide. The filenames are cut off at the right.

This command -- with the second argument incremented by only 1:

echo %@select[test.tmp,0,50,300,200,Pick a filename]

produces a SELECT window that runs off the right edge of the screen and has to be dragged leftward to be seen in its entirety. (So the filenames are cut off on the right edge in the first case and have a ton of white-space to their right in the second.)

Why is this? What am I doing wrong in both cases? (I've been having trouble understanding @select[]'s logic in how it displays its window. So I chose the other numbers in the command somewhat arbitrarily.)


Scott Mintz
May 20, 2008
Solon, OH, USA
If the specified width is < 150, the top, left, bottom, right parameters are assumed to be rows/columns relative to the TCC window. If the width is >= 150, the parameters are assumed to be screen coordinates (in pixels).

Your width in your first example is 151 (200 - 49), so the values are interpreted as pixels. Given the behavior you describe for the second, I'm guessing that width has to be > 150 and not >= 150, because you created a window that was 150 characters wide (200 - 50).
Dec 7, 2009
Left Coast, USA
Ok, I get my error with the width now -- thanks for that.

I continue to see SELECT windows in which the last line is cut off, no matter what height I give the window. If I add a blank line to the end of the text file I'm "feeding" to @select[], then I see the last visible line in the file. But that kind of workaround is kind of unpleasant and shouldn't be necessary.

The SELECT window seems to adjust itself to the height of its contents, rather than to the height requested via the @select[] command. That was not how it worked in 4NT. At least, not that I recall.

With the two-line text file (which does have <cr><lf> as its last characters, if it matters):

%@select[test.tmp,0,0,75,60,Pick a filename]

...the second of the two filenames is not fully visible in the SELECT window. But then:

echo.>> test.tmp

Now there's a blank line at the end of the text file. I use the same parameters for @select[], and now both of the visible lines containing filenames can be seen -- and the window cuts off the blank line. This is not an especially welcome sort of workaround. It would call for additional batch code to deal with: what if the selection is "" BUT the user hasn't pressed Esc? I don't even know if it's possible to make that distinction.

I have reported this cutting-off at the bottom of the window before. Can anyone replicate it? Or is there some obviously mis-set @select[] parameter that I've simply overlooked?

( TCC 15.01.52 x64 Windows 7 [Version 6.1.7601] )
Similar threads
Thread starter Title Forum Replies Date
MikeBaas Understanding SHIFT Support 3
Roedy How to? Understanding BTM file properties Support 0
C Cmpr_Del.btm need help understanding UDF..... Support 2
M How to? What am I doing wrong/not understanding? Support 10
J Still problems understanding "foldermonitor" Support 9
R @select inside alias gives different (insanely small) window Support 7
Joe Caverly Windows Terminal and @SELECT Support 13
WinLanEm @SELECT problem Support 6
T @select and @selectarray issues Support 2
C How to? Select 100 random pictures from 30,000 Support 8
MikeBaas How to? SELECT: exclude files / display prompt Support 2
rps Documentation "Select" command switch order incorrect Support 4
mikea How to? @select[] window size, redux. Support 3
vefatica IDE double-click select? Support 29
gschizas How to? How can I use select with a folder that already contains parentheses? Support 7
T How to? Select and Delete text Support 6
vhodro How to? Select text Support 10
WavSlave Fixed Escaping out of SELECT sometimes still executes the command Support 2
B Select and run lines from Command Input panel? Support 1
nikbackm Fixed v15: Issue with @select Support 3
G Fixed v15.00.27: @SELECT Support 10
D ini directives and @select example in Help Support 0
ehab aboudaya How to? Copy to clipboard on select Support 5
Phileosophos SELECT command opens additional tab Support 9
S SELECT DEL (*D.DLL) - output curious Support 8
vefatica Positioning @SELECT[] popup? Support 3
WadeHatler Any way to restore the Text Based "Select File" Windows in TCC Support 2
Stefano Piccardi how to @SELECT redirected input? Support 4
Joe Caverly Error when sorting list alphabetically for @select Support 2
S SELECT - does it support ranges? Support 2
nikbackm @select function and TAB characters Support 1
Joe Caverly @select like 4DOS Support 1
D Can you feed a file list to SELECT? Support 1
A @select versio 10.31 Support 1
nikbackm @select window problem Support 12

Similar threads