Welcome!

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

SignUp Now!

What am I doing wrong here?

May
855
0
Here's a few simple commands with their outputs:
Code:
[Z:\Work]Echo "%Description"
"abc def  ("

[Z:\Work]Echo "%Amount"
"124.45)"

[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?
 
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.

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

v:\> echo %@len[(] %@right[1,)]
1 )
 
Here's another that I find quite curious.
Code:
v:\> echo %%( %@right[1,z]
%( %@right[1,z]

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

Similar threads

G
Replies
8
Views
3K
Back
Top