What am I doing wrong here?

May 24, 2010
Northlake, Il
Here's a few simple commands with their outputs:
[Z:\Work]Echo "%Description"
"abc def  ("

[Z:\Work]Echo "%Amount"

[Z:\Work]Echo Iff %@Right[1,%Description] %@Right[1,%Amount]
Iff ( %@Right[1,%Amount]

[Z:\Work]Echo Iff %@Right[1,%Amount]
Iff )

Hopefully it is obvious that the output of the second to last command is not what I would expect. Does the open parenthesis have anything to do with it?
May 20, 2008
Syracuse, NY, USA
I dunno. But here (first example below) it is boiled down a bit. It evaluates and echoes the first arg "( " correctly and doesn't seem to evaluate the second arg. The second example below shows that an unmatched parenthesis inside a function is not always a problem.

v:\> echo %@right[1,(] %@right[1,z]
( %@right[1,z]

v:\> echo %@len[(] %@right[1,)]
1 )
May 20, 2008
Syracuse, NY, USA
Here's another that I find quite curious.
v:\> echo %%( %@right[1,z]
%( %@right[1,z]

v:\> echo %% ( %@right[1,z]
% ( z
Similar threads
Thread starter Title Forum Replies Date
M How to? What am I doing wrong/not understanding? Support 10
M What am I doing wrong? Support 12
M What am I doing wrong in this (very simple!) code? Support 3
M How to? Missing closing quote: What am I doing wrong???? Support 7
fishman@panix.com V23 cdd /s doing WIERD things. Support 5
P Doing math with TCC Support 11
B when doing SFTP via IFTP to my secure site my users always get the finger print key prompt Support 1
C take command 19 not doing well under windows 10 build 14295 Support 3
fromano Fixed /E not working in TCMD 17.0.40 while doing one way synch Support 1
fromano Fixed TCC crashing inside TCMD 17.0.35 after doing a copy Support 11
M Hotkey-mechanism, for doing something with the current command-line Support 4
M Unexpected Results from Doing Numeric Comparisons... Support 17
vefatica Who's doing the cacheing? Support 6
JohnQSmith New online help file wrong logo Support 7
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
T @replace -- what is wrong here Support 2
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
C News link wrong Support 1
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
vefatica Something wrong with @PID Support 10
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3
vefatica What's wrong here? Support 2
vefatica Wrong startup file? Support 1
gschizas (minor) Help topic "Colors, Color Names and Codes" is wrong Support 0
T Wrong prompt in Windows command console Support 3
M Where am I going wrong with ALIAS??? Support 7
G Wrong File Size Support 8
vefatica Updating v10: error wrong file size Support 2
S Wrong .INI file used by TCC Support 2
K_Meinhard Wrong sender adress Support 0
Joe Caverly Here-Document on new Install Support 21
nikbackm Switch Case and here-document redirection Support 2

Similar threads