Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@SELECT problem

Sep
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
 
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]
 
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
 
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]
 
The BTM shown in the @SELECT window shows how to center it given its dimensions in pixels.
upload_2017-8-1_16-18-32.png
 
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

Back
Top