@select inside alias gives different (insanely small) window

Jun 19, 2008
14
0
TCC 26.02.42 x64 Windows 10 [Version 10.0.19041.630]

I'm trying to see if I can upgrade my ancient 4NT to TCC. In 4NT, I had the following alias:
@alias gd `set gd_sel=%@select[%[DATRLB]\4nt\gd.txt, 1, 1, 20, 80, 'gd: Goto Directory'] &^ iff "%[gd_sel]" != "" then &^ iff isdir %@word[1,%[gd_sel]] then &^ cdd %@word[1,%[gd_sel]] &^ else &^ echo "That directory doesn't exist! (%[gd_sel])" &^ endiff &^ else &^ echo "OK, no selection. (%[gd_sel])" &^ endiff &^ `
(DATRLB is just a directory prefix). In TCC, this produces a tiny window with absurdly small text:

foo.png


However, if I cut and paste the first line in the alias into my console, it produces an @SELECT window of normal size. Likewise, if I make that cut and paste into an alias, it still seems to work fine, making it hard to create a more minimal example. I can't see any relevant changes in any of the command I'm using. I'm stuck. Any ideas where to look for the problem?

Making a selection in the tiny window also produces the text "The process ID is nnnn" (where nnnn is a presumably real process ID). So maybe I've gotten something really messed up when trying to just drop TCC in as a 4NT replacement.
 
Jun 19, 2008
14
0
Hmmm, well, docs say TCC switches behavior depending on whether width is >= 150; that seems to be true interactively at least.

@SELECT TCC internal variable function
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).
Do I misunderstand the help file?
 
Jun 19, 2008
14
0
Through tedious binary search, it appears that tcc, unlike 4nt, does not like the space after the final endiff. If I change this:
Code:
endiff &^
to this:
Code:
endiff&^
then the select window is normal, no message about a process ID, etc. Wonder what's really going on there?
Here's a simple alias that I guess spawns another process for reasons I can't grasp:
Code:
@alias bug1 `&^
iff "1" == "1" then &^
    echo one with everything &^
endiff &^
`
But if you remove the space after the endiff, it behaves normally.
 
Jun 19, 2008
14
0
Just typing endiff & followed by Enter produces a message like "The process ID is nnnn". Or, I guess you can substitute any command for the endiff and get the same result.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
Just typing endiff & followed by Enter produces a message like "The process ID is nnnn". Or, I guess you can substitute any command for the endiff and get the same result.
Documented but obscure feature; the trailing ampersand is an alternative (Linuxy) way of doing a DETACH.

I'm not sure it should work with ENDIFF, though. Seeing as how ENDIFF is not actually a command.
 
Jun 19, 2008
14
0
Documented but obscure feature; the trailing ampersand is an alternative (Linuxy) way of doing a DETACH.

I'm not sure it should work with ENDIFF, though. Seeing as how ENDIFF is not actually a command.
Thanks, one mystery solved. I assume you're referring to the one-line note in the help file entry for DETACH? The space required before the ampersand (for DETACH, but not for separating commands!) remains undocumented, unless its lurking somewhere else.

I can't tell if the documentation saying the pseudovariable %+ "is deprecated as of Take Command v17, and most support has been removed in v20" applies to TCC. If that can't be relied on, then I guess writing robust batch files requires being aware of the obscure rules for parsing of & and hoping nobody changes the command separator outside the batch file.
 
Jun 19, 2008
14
0
And the unusable tiny select window can be produced as simply as:
Code:
echo foo >foo.txt
%@select[foo.txt, 1, 1, 20, 80, 'bugg'] &
Removing the trailing space-ampersand produces the correct size selection window.

Possibly it should refuse to run rather than go bonkers in this situation.
 
Similar threads
Thread starter Title Forum Replies Date
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
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
nikbackm @select window problem Support 12
old coot Proper use of ON ERRORMSG inside a DO WHILE loop? Support 3
A bdebugger: why it doesnt go inside the "if" statement ? Support 3
fromano Fixed TCC crashing inside TCMD 17.0.35 after doing a copy Support 11
vefatica Single-line DO inside nested multi-line DOs? Support 9
J issue to have "if" inside function Support 3
Stefano Piccardi IDE unexpectedly exits inside this batch file Support 17
nikbackm Command line evaluation question - variable inside parenthesis Support 7
D Can alias pass parameters to for command? Support 3
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
kb6ojs ALIAS with multiple commands? Support 9
vefatica Can I alias @@Ctrl-Shift-Alt-u? Support 4
D Alias with setdos no longer works Support 21
vefatica TPIPE in an alias? Support 2
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
samintz How to? Alias or prompt? Support 1
MickeyF expand alias in cmdline with Ctrl-F in TCC Support 21
Jay Sage Directory Alias Access to FTP Servers Support 2

Similar threads