@SELECT problem

Sep 13, 2016
50
0
Code:
@echo off
echo 1. One > 1.tmp
echo 2. Two >>! 1.tmp

set sel=%@select[1.tmp,7,24,11,55]>con

TCC v.15 result:
upload_2017-8-1_14-52-53.png


TCC v.21 result:
upload_2017-8-1_14-53-46.png


In version 21, the @SELECT window is out of the console
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
I'm unable to reproduce that here. Are you using the same font in both TCC sessions?

You're using the (very) old & deprecated 4DOS syntax. @SELECT was changed 10+ years ago to take window coordinates (relative to the TCC window), not row/column arguments. For the sake of compatibility with old batch files, @SELECT will assume that a width < 150 means you want rows & columns, and it will take your arguments & multiply them by the font width & height to get the window coordinates.

If you want to be sure you get the right position and size, try using window coordinates (by pixel) instead. Something like:

@SELECT[1.tmp, 70,100,200,500]
 
May 20, 2008
11,388
99
Syracuse, NY, USA
For me, it doesn't seem to get the right side correct.
upload_2017-8-1_13-14-26.png

If I start v20 in the same console, and give the same command, it looks better. There's a minor difference in the left side too.
upload_2017-8-1_13-16-25.png
 
Sep 13, 2016
50
0
Yes, the fonts are the same in both sessions.

This problem began with version 20. Prior to version 20 @select worked correctly.
If this can not be fixed, please tell me the formula for positioning the @select window in the center of the TCC session, in pixels.
I'm unable to reproduce that here. Are you using the same font in both TCC sessions?

You're using the (very) old & deprecated 4DOS syntax. @SELECT was changed 10+ years ago to take window coordinates (relative to the TCC window), not row/column arguments. For the sake of compatibility with old batch files, @SELECT will assume that a width < 150 means you want rows & columns, and it will take your arguments & multiply them by the font width & height to get the window coordinates.

If you want to be sure you get the right position and size, try using window coordinates (by pixel) instead. Something like:

@SELECT[1.tmp, 70,100,200,500]
 

rconn

Administrator
Staff member
May 14, 2008
12,340
149
I was eventually able to reproduce this (the third machine I tried).

The @SELECT code is the same in v19 and v21. The issue turned out to be the font selected for the popup windows. If it's a font that supports double-wide characters, when TCC queries it for the character width (so it can multiply that by the specified number of columns), Windows returns the width of a double-side character. I've added a kludge for build 40 that forces calls made with the old/obsolete/deprecated format (row/column instead of window coordinates) to return the width of a single-wide character.
 
Similar threads
Thread starter Title Forum Replies Date
nikbackm @select window problem Support 12
R @select inside alias gives different (insanely small) window Support 7
Joe Caverly Windows Terminal and @SELECT Support 13
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
mikea How to? Understanding @select[] Support 2
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
Dick Johnson Weird Color Problem Support 8
fishman@panix.com Problem with 27.15 Support 2
M Problem with VSDevCmd.bat in VS 16.7.3 Support 0
R Problem with @INT[ value] in V26 Support 9
M Selecting test "off by one" problem in Take command Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
K_Meinhard Small problem in german IDE 26 Support 3
B Problem with color in nested shells Support 1
Joe Caverly Problem creating and switching to a DESKTOP Support 9
vefatica Another popup problem Support 10
Alpengreis ffind dialog (/W) problem Support 4
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
A Problem with functions @int @decimal and identifying Powershell as a shell. Support 12
B IF command problem in tcexit.btm Support 9
fishman@panix.com Problem at Startup of TCC Support 3
P Problem with SFTP copies Support 7
P Problem with FTP copies Support 10
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
R Problem with %_do_loop in nested do loops Support 2

Similar threads