1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What am I doing wrong here?

Discussion in 'Support' started by mathewsdw, Dec 26, 2013.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    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?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,877
    Likes Received:
    30
    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 )
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,877
    Likes Received:
    30
    Here's another that I find quite curious.
    Code:
    v:\> echo %%( %@right[1,z]
    %( %@right[1,z]
    
    v:\> echo %% ( %@right[1,z]
    % ( z
     

Share This Page