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

WAD DO, ECHO, and trailing whitespace

Discussion in 'Support' started by vefatica, Sep 8, 2013.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,078
    Likes Received:
    30
    Can you please change this behavior?
    Code:
    v:\> echos foo^t & echo bar
    foo    bar
    
    v:\> (echos foo^t & echo bar)
    foo    bar
    
    v:\> do i=1 to 5 (echos foo^t & echo bar)
    foobar
    foobar
    foobar
    foobar
    foobar
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,358
    Likes Received:
    39
    Shouldn't you be doubling the carat in the last example?
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,078
    Likes Received:
    30
    Yeah! Thanks! But it doesn't make a heck of a lot of sense (the memorable kind of sense) ... I don't have to double %s but I do have to double ^s.
    Code:
    v:\> do i=1 to 5 (echos %_second^^s & delay 1 )
    40 41 42 43 44
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    WAD - the ( ) in a DO is not a command group, it's a command line to execute. The ^ is parsed and expanded before the DO is executed. This is no different from a FOR argument list.

    And no, it can't be changed (but I could remove the DO () syntax if you prefer).
     

Share This Page